View | Details | Raw Unified | Return to bug 30825
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Item.t (-2 / +24 lines)
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 => 29;
23
use Test::More tests => 30;
24
use Test::Exception;
24
use Test::Exception;
25
use Test::MockModule;
25
use Test::MockModule;
26
26
Lines 2211-2213 subtest 'current_branchtransfers relationship' => sub { Link Here
2211
2211
2212
    $schema->storage->txn_rollback;
2212
    $schema->storage->txn_rollback;
2213
};
2213
};
2214
- 
2214
2215
subtest 'holds_control_library() tests' => sub {
2216
2217
    plan tests => 2;
2218
2219
    $schema->storage->txn_begin;
2220
2221
    my $library_1 = $builder->build_object({ class => 'Koha::Libraries' });
2222
    my $library_2 = $builder->build_object({ class => 'Koha::Libraries' });
2223
2224
    my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $library_1->id } });
2225
    my $item   = $builder->build_sample_item({ library => $library_2->id });
2226
2227
    t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'ItemHomeLibrary' );
2228
2229
    is( $item->holds_control_library( $patron ), $library_2->id );
2230
2231
    t::lib::Mocks::mock_preference( 'ReservesControlBranch', 'PatronLibrary' );
2232
2233
    is( $item->holds_control_library( $patron ), $library_1->id );
2234
2235
    $schema->storage->txn_rollback;
2236
};

Return to bug 30825