Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use utf8; |
19 |
use utf8; |
20 |
|
20 |
|
21 |
use Test::More tests => 49; |
21 |
use Test::More tests => 50; |
|
|
22 |
use Test::Exception; |
22 |
use Test::MockModule; |
23 |
use Test::MockModule; |
23 |
use Test::Deep qw( cmp_deeply ); |
24 |
use Test::Deep qw( cmp_deeply ); |
24 |
|
25 |
|
Lines 4449-4454
subtest 'Tests for NoRefundOnLostReturnedItemsAge with AddIssue' => sub {
Link Here
|
4449 |
}; |
4450 |
}; |
4450 |
}; |
4451 |
}; |
4451 |
|
4452 |
|
|
|
4453 |
subtest 'transferbook tests' => sub { |
4454 |
plan tests => 9; |
4455 |
|
4456 |
throws_ok |
4457 |
{ C4::Circulation::transferbook({}); } |
4458 |
'Koha::Exceptions::MissingParameter', |
4459 |
'Koha::Patron->store raises an exception on missing params'; |
4460 |
|
4461 |
throws_ok |
4462 |
{ C4::Circulation::transferbook({to_branch=>'anything'}); } |
4463 |
'Koha::Exceptions::MissingParameter', |
4464 |
'Koha::Patron->store raises an exception on missing params'; |
4465 |
|
4466 |
throws_ok |
4467 |
{ C4::Circulation::transferbook({from_branch=>'anything'}); } |
4468 |
'Koha::Exceptions::MissingParameter', |
4469 |
'Koha::Patron->store raises an exception on missing params'; |
4470 |
|
4471 |
my ($doreturn,$messages) = C4::Circulation::transferbook({to_branch=>'there',from_branch=>'here'}); |
4472 |
is( $doreturn, 0, "No return without barcode"); |
4473 |
ok( exists $messages->{BadBarcode}, "We get a BadBarcode message if no barcode passed"); |
4474 |
is( $messages->{BadBarcode}, undef, "No barcode passed means undef BadBarcode" ); |
4475 |
|
4476 |
my ($doreturn,$messages) = C4::Circulation::transferbook({to_branch=>'there',from_branch=>'here',barcode=>'BadBarcode'}); |
4477 |
is( $doreturn, 0, "No return without barcode"); |
4478 |
ok( exists $messages->{BadBarcode}, "We get a BadBarcode message if no barcode passed"); |
4479 |
is( $messages->{BadBarcode}, 'BadBarcode', "No barcode passed means undef BadBarcode" ); |
4480 |
|
4481 |
}; |
4482 |
|
4452 |
$schema->storage->txn_rollback; |
4483 |
$schema->storage->txn_rollback; |
4453 |
C4::Context->clear_syspref_cache(); |
4484 |
C4::Context->clear_syspref_cache(); |
4454 |
$branches = Koha::Libraries->search(); |
4485 |
$branches = Koha::Libraries->search(); |
4455 |
- |
|
|