Bug 41795: Fix failing test in UNIMARC instances

Previously, t/AuthoritiesMarc_MARC21.t would fail if
you tried to run it from within a UNIMARC instance.

This patch fixes that.

Test plan:

1) Inside a UNIMARC instance, run the test and
   notice the subtest failure:

   $ prove -v t/AuthoritiesMarc_MARC21.t

2) Apply this patch.

3) Re-run the test and notice that it now completes
   without any failures.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Andreas Roussos 2026-02-09 01:52:30 +00:00 committed by Lucas Gass
parent e43d32a123
commit 2b691bd4dd
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 9 additions and 1 deletions

View File

@ -59,9 +59,17 @@ subtest "FindDuplicateAuthority tests" => sub {
}
);
my $marcflavour = C4::Context->preference('marcflavour');
my $field;
if ( $marcflavour eq 'MARC21' ) {
$field = '155'; # GENRE/FORM field in MARC21
} elsif ( $marcflavour eq 'UNIMARC' ) {
$field = '280'; # GENRE/FORM field in UNIMARC
}
my $record = MARC::Record->new;
$record->append_fields(
MARC::Field->new( '155', '', '', a => 'Potato' ),
MARC::Field->new( $field, '', '', a => 'Potato' ),
);
t::lib::Mocks::mock_preference( 'SearchEngine', 'Zebra' );