Bug 9578: add regression test

This patch adds a regression test for the condition noted
in bug 9578, where attempting a sort of a Zebra search that
fails because of an invalid query crashes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 70499239ba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Conflicts:
	t/db_dependent/Search.t
This commit is contained in:
Galen Charlton 2014-04-18 22:33:11 +00:00 committed by Fridolin Somers
parent ff077e30d3
commit 18405a4595
1 changed files with 7 additions and 1 deletions

View File

@ -12,7 +12,7 @@ use YAML;
use C4::Debug;
require C4::Context;
use Test::More tests => 224;
use Test::More tests => 226;
use Test::MockModule;
use MARC::Record;
use File::Spec;
@ -776,6 +776,12 @@ sub run_marc21_search_tests {
is($count, 1, 'MARC21 authorities: one hit on match contains "沙士北亞威廉姆" (QP)');
# verify that we don't attempt to sort if no results were returned
# because of a query error
warning_like {( undef, $results_hashref, $facets_loop ) =
getRecords('ccl=( AND )', '', ['title_az'], [ 'biblioserver' ], '20', 0, undef, \%branches, \%itemtypes, 'ccl', undef)
} qr/WARNING: query problem with/, 'got warning instead of crash when attempting to run invalid query (bug 9578)';
cleanup();
}