Lines 20-26
Link Here
|
20 |
use Modern::Perl; |
20 |
use Modern::Perl; |
21 |
use utf8; |
21 |
use utf8; |
22 |
|
22 |
|
23 |
use Test::More tests => 15; |
23 |
use Test::More tests => 16; |
24 |
use Test::Exception; |
24 |
use Test::Exception; |
25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
26 |
|
26 |
|
Lines 1454-1456
subtest 'Recalls tests' => sub {
Link Here
|
1454 |
$schema->storage->txn_rollback; |
1454 |
$schema->storage->txn_rollback; |
1455 |
}; |
1455 |
}; |
1456 |
|
1456 |
|
1457 |
- |
1457 |
subtest 'holds_control_library() tests' => sub { |
|
|
1458 |
|
1459 |
plan tests => 2; |
1460 |
|
1461 |
$schema->storage->txn_begin; |
1462 |
|
1463 |
my $library_1 = $builder->build_object({ class => 'Koha::Libraries' }); |
1464 |
my $library_2 = $builder->build_object({ class => 'Koha::Libraries' }); |
1465 |
|
1466 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $library_1->id } }); |
1467 |
my $item = $builder->build_sample_item({ library => $library_2->id }); |
1468 |
|
1469 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
1470 |
|
1471 |
is( $item->holds_control_library( $patron ), $library_2->id ); |
1472 |
|
1473 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'PatronLibrary' ); |
1474 |
|
1475 |
is( $item->holds_control_library( $patron ), $library_1->id ); |
1476 |
|
1477 |
$schema->storage->txn_rollback; |
1478 |
}; |