X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=t%2FSearch_PazPar2.t;h=62b622d97afbe3005234cccd42c8b87324769ba6;hb=4e139a237b874df5fcd2169abba75eb3745239f5;hp=8d51720aaccb962d9d6f60513eeb45756db1933b;hpb=e0892a5139d68249db0c8acec03eae008f850509;p=koha.git diff --git a/t/Search_PazPar2.t b/t/Search_PazPar2.t index 8d51720aac..62b622d97a 100755 --- a/t/Search_PazPar2.t +++ b/t/Search_PazPar2.t @@ -3,12 +3,45 @@ # This Koha test module is a stub! # Add more tests here!!! -use strict; -use warnings; +use Modern::Perl; -use Test::More tests => 1; +use Test::More tests => 14; +use Test::Warn; BEGIN { use_ok('C4::Search::PazPar2'); } +my $obj = C4::Search::PazPar2->new(); +ok ($obj, "testing new works"); + +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");