Browse Source

Bug 14117: Silence warnings t/SearchPazPar2.t

The use of relative URLS (null actually), triggers warnings.
Catch them, instead of letting them loose.

TEST PLAN
---------
1) $ prove t/Search_PazPar2.t
   -- noise for each test currently.
2) apply patch
3) $ prove t/Search_PazPar2.t
   -- No noise, and extra tests added.
      -v shows caught warning tests.
4) koha qa test tools.

Signed-off-by: Indranil Das Gupta <indradg@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
3.22.x
Mark Tompsett 6 years ago
committed by Tomas Cohen Arazi
parent
commit
a4b7df4490
  1. 43
      t/Search_PazPar2.t

43
t/Search_PazPar2.t

@ -3,10 +3,10 @@
# This Koha test module is a stub!
# Add more tests here!!!
use strict;
use warnings;
use Modern::Perl;
use Test::More tests => 8;
use Test::More tests => 14;
use Test::Warn;
BEGIN {
use_ok('C4::Search::PazPar2');
@ -14,9 +14,34 @@ BEGIN {
my $obj = C4::Search::PazPar2->new();
ok ($obj, "testing new works");
is ($obj->init(), "1", "testing init returns '1' when given no arguments");
is ($obj->search(), "1", "testing search returns '1' when given no arguments");
is ($obj->stat(), undef, "testing stat returns undef when given no arguments");
is ($obj->show(), undef, "testing show returns undef when given no arguments");
is ($obj->record(), undef, "testing record returns undef when given no arguments");
is ($obj->termlist(), undef, "testing termlist returns undef when given no arguments");
my $result;
warning_like { $result = $obj->init(); }
qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
"Expected relative URL warning";
is ($result, "1", "testing init returns '1' when given no arguments");
warning_like { $result = $obj->search(); }
qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
"Expected relative URL warning";
is ($result, "1", "testing search returns '1' when given no arguments");
warning_like { $result = $obj->stat(); }
qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
"Expected relative URL warning";
is ($result, undef, "testing stat returns undef when given no arguments");
warning_like { $result = $obj->show(); }
qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
"Expected relative URL warning";
is ($result, undef, "testing show returns undef when given no arguments");
warning_like { $result = $obj->record(); }
qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
"Expected relative URL warning";
is ($result, undef, "testing record returns undef when given no arguments");
warning_like { $result = $obj->termlist(); }
qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
"Expected relative URL warning";
is ($result, undef, "testing termlist returns undef when given no arguments");
Loading…
Cancel
Save