Bug 36081: Force TestBuilder to generate a valid format value

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
This commit is contained in:
Jonathan Druart 2025-01-31 14:10:03 +01:00 committed by Alex Buckley
parent 7b0f6f6bc1
commit 5ff06fd18d
1 changed files with 6 additions and 0 deletions

View File

@ -575,6 +575,12 @@ sub _gen_blob {
sub _gen_default_values {
my ($self) = @_;
return {
ArticleRequest => {
format => sub {
my $formats = C4::Context->multivalue_preference('ArticleRequestsSupportedFormats');
return $formats->[ int( rand( scalar @$formats ) ) ];
}
},
AuthorisedValueCategory => {
is_integer_only => 0,
},