Bug 20596: Add unit test for multiple values in authority search

This patch adds a unit test which returns 2 authority records
via an implicit OR when searching for strings from two different
authority records.

Test plan:
1. prove t/db_dependent/Search.t

Signed-off-by: Jan Kissig <jan.kissig@th-wildau.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
David Cook 2022-12-14 05:17:02 +00:00 committed by Tomas Cohen Arazi
parent b2a23149bd
commit 76d676a868
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -751,6 +751,13 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
);
is($count, 1, 'MARC21 authorities: one hit on "all" (entire record) contains "professional wrestler"');
#NOTE: the 2nd parameter is unused in SearchAuthorities...
($auths, $count) = SearchAuthorities(
['Any','Any'], [''], [''], ['contains'],
['professional wrestler','shakespeare'], 0, 10, '', '', 1
);
is($count, 2, 'MARC21 authorities: multiple values create operands implicitly joined by OR');
# retrieve records that are larger than the MARC limit of 99,999 octets
( undef, $results_hashref, $facets_loop ) =
getRecords('ti:marc the large record', '', [], [ 'biblioserver' ], '20', 0, \%branches, \%itemtypes, 'ccl', undef);
@ -923,7 +930,7 @@ sub run_unimarc_search_tests {
}
subtest 'MARC21 + DOM' => sub {
plan tests => 92;
plan tests => 93;
run_marc21_search_tests();
};