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 => 30; |
23 |
use Test::More tests => 31; |
24 |
use Test::Exception; |
24 |
use Test::Exception; |
25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
26 |
|
26 |
|
Lines 2295-2297
subtest 'current_branchtransfers relationship' => sub {
Link Here
|
2295 |
|
2295 |
|
2296 |
$schema->storage->txn_rollback; |
2296 |
$schema->storage->txn_rollback; |
2297 |
}; |
2297 |
}; |
2298 |
- |
2298 |
|
|
|
2299 |
subtest 'holds_control_library() tests' => sub { |
2300 |
|
2301 |
plan tests => 2; |
2302 |
|
2303 |
$schema->storage->txn_begin; |
2304 |
|
2305 |
my $library_1 = $builder->build_object({ class => 'Koha::Libraries' }); |
2306 |
my $library_2 = $builder->build_object({ class => 'Koha::Libraries' }); |
2307 |
|
2308 |
my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $library_1->id } }); |
2309 |
my $item = $builder->build_sample_item({ library => $library_2->id }); |
2310 |
|
2311 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
2312 |
|
2313 |
is( $item->holds_control_library( $patron ), $library_2->id ); |
2314 |
|
2315 |
t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'PatronLibrary' ); |
2316 |
|
2317 |
is( $item->holds_control_library( $patron ), $library_1->id ); |
2318 |
|
2319 |
$schema->storage->txn_rollback; |
2320 |
}; |