Bug 9303 [3] - relative's checkouts in the opac
[koha.git] / t / Search_PazPar2.t
1 #!/usr/bin/perl
2 #
3 # This Koha test module is a stub!  
4 # Add more tests here!!!
5
6 use Modern::Perl;
7
8 use Test::More tests => 14;
9 use Test::Warn;
10
11 BEGIN {
12         use_ok('C4::Search::PazPar2');
13 }
14
15 my $obj = C4::Search::PazPar2->new();
16 ok ($obj, "testing new works");
17
18 my $result;
19 warning_like { $result = $obj->init(); }
20     qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
21     "Expected relative URL warning";
22 is ($result, "1", "testing init returns '1' when given no arguments");
23
24 warning_like { $result = $obj->search(); }
25     qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
26     "Expected relative URL warning";
27 is ($result, "1", "testing search returns '1' when given no arguments");
28
29 warning_like { $result = $obj->stat(); }
30     qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
31     "Expected relative URL warning";
32 is ($result, undef, "testing stat returns undef when given no arguments");
33
34 warning_like { $result = $obj->show(); }
35     qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
36     "Expected relative URL warning";
37 is ($result, undef, "testing show returns undef when given no arguments");
38
39 warning_like { $result = $obj->record(); }
40     qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
41     "Expected relative URL warning";
42 is ($result, undef, "testing record returns undef when given no arguments");
43
44 warning_like { $result = $obj->termlist(); }
45     qr/400 URL must be absolute at .*C4\/Search\/PazPar2.pm/,
46     "Expected relative URL warning";
47 is ($result, undef, "testing termlist returns undef when given no arguments");