Bug 28373: (follow-up) QA fixes
authorNick Clemens <nick@bywatersolutions.com>
Mon, 23 Aug 2021 14:12:26 +0000 (14:12 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 31 Aug 2021 07:43:14 +0000 (09:43 +0200)
Use fully qualified subroutine name
Don't return explicit undef

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/Search.t

index 64b6e50dc608c7a0078fcdc4f2c98ca4d7594dc6..11d6eb54b7477b96b0df14ec9686510be9926443 100755 (executable)
@@ -181,9 +181,10 @@ subtest "searchResults PassItemMarcToXSLT test" => sub {
     t::lib::Mocks::mock_preference('marcflavour','MARC21');
     my $mock_xslt = Test::MockModule->new("C4::Search");
     $mock_xslt->mock( XSLTParse4Display => sub {
-       my (undef, $record) = @_;
+        my $params = shift;
+        my $record = $params->{record};
         warn $record->field('952') ? "Item here" : "No item";
-        return undef;
+        return;
     });
 
     my $builder = t::lib::TestBuilder->new;
@@ -194,13 +195,13 @@ subtest "searchResults PassItemMarcToXSLT test" => sub {
 
     t::lib::Mocks::mock_preference('PassItemMarcToXSLT','1');
 
-    warnings_like { searchResults({ interface => "opac" },"test",1,1,0,0,[ $record->as_xml_record ] ,undef) }
+    warnings_like { C4::Search::searchResults({ interface => "opac" },"test",1,1,0,0,[ $record->as_xml_record ] ,undef) }
         [qr/Item here/],
         "Item field returned from default XSLT if pref set";
 
     t::lib::Mocks::mock_preference('PassItemMarcToXSLT','0');
 
-    warnings_like { searchResults({ interface => "opac" },"test",1,1,0,0,[ $record->as_xml_record ] ,undef) }
+    warnings_like { C4::Search::searchResults({ interface => "opac" },"test",1,1,0,0,[ $record->as_xml_record ] ,undef) }
         [qr/No item/],
         "Item field returned from default XSLT if pref set";