Bug 25277: Unit test
authorNick Clemens <nick@bywatersolutions.com>
Fri, 24 Apr 2020 16:08:44 +0000 (16:08 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 18 May 2020 14:27:22 +0000 (15:27 +0100)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

t/db_dependent/Koha/Z3950Responder/GenericSession.t

index f888b02..33dc662 100644 (file)
@@ -23,7 +23,7 @@ our $child;
 
 subtest 'test_search' => sub {
 
-    plan tests => 19;
+    plan tests => 20;
 
     t::lib::Mocks::mock_preference('SearchEngine', 'Elasticsearch');
 
@@ -75,7 +75,7 @@ subtest 'test_search' => sub {
     $search->mock('simple_search_compat', sub {
         my ( $self, $query ) = @_;
 
-        return ('unexpected query', undef, 0) unless $query eq '((author:(author)) AND ((title:(title\(s\))) OR (title:(speciäl))))';
+        return ('unexpected query', undef, 0) unless $query eq '((author:(author)) AND ((title:(title\(s\))) OR (title:(speciäl))))' || $query eq "(simple search)";
 
         my @records = ($marc_record_1, $marc_record_2);
         return (undef, \@records, 2);
@@ -117,6 +117,9 @@ subtest 'test_search' => sub {
     ok($returned2, 'Record 2 returned as MARCXML');
     is($returned2->as_xml, $marc_record_2->as_xml, 'Record 2 returned properly');
 
+    $rs = $Zconn->search_pqf('"simple search"');
+    is($Zconn->errcode(), 0, 'Search is successful: ' . $Zconn->errmsg());
+
     # SRU protocol tests
     my $base = 'http://localhost:42111';
     my $ns = 'http://www.loc.gov/zing/srw/';