Bug 28365: Add unit test

Run prove t/db_dependent/Search.t

Without fix you get error :
    #   Failed test 'buildQuery should keep 0 value in query_cgi'
    #   at t/db_dependent/Search.t line 670.
    #          got: 'idx=su%2Cphr'
    #     expected: 'idx=su%2Cphr&q=0'

This patch also adds a test for query_desc in case it is broken in the
future.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Fridolin Somers 2021-05-17 16:15:19 +02:00 committed by Jonathan Druart
parent 9ead068920
commit e9a68f9f7d
1 changed files with 4 additions and 2 deletions

View File

@ -641,7 +641,9 @@ ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
( $error, $query, $simple_query, $query_cgi,
$query_desc, $limit, $limit_cgi, $limit_desc,
$query_type ) = buildQuery([], [ 0 ], [ 'su,phr' ], [], [], 0, 'en');
is($query, 'su,phr=(rk=(0)) ', 'buildQuery should keep 0 value');
is($query, 'su,phr=(rk=(0)) ', 'buildQuery should keep 0 value in query');
is($query_cgi, 'idx=su%2Cphr&q=0', 'buildQuery should keep 0 value in query_cgi');
is($query_desc, 'su,phr: 0', 'buildQuery should keep 0 value in query_desc');
# Bug 23086
( $error, $query, $simple_query, $query_cgi,
@ -899,7 +901,7 @@ sub run_unimarc_search_tests {
}
subtest 'MARC21 + DOM' => sub {
plan tests => 88;
plan tests => 90;
run_marc21_search_tests();
};