Lines 17-25
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 62; |
20 |
use Test::More tests => 64; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
|
|
23 |
use Test::Exception; |
23 |
|
24 |
|
24 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
25 |
use t::lib::TestBuilder; |
26 |
use t::lib::TestBuilder; |
Lines 533-538
$item = Koha::Items->find($itemnumber);
Link Here
|
533 |
|
534 |
|
534 |
ok( C4::Reserves::IsAvailableForItemLevelRequest($item, $patron), "Reserving a book on item level" ); |
535 |
ok( C4::Reserves::IsAvailableForItemLevelRequest($item, $patron), "Reserving a book on item level" ); |
535 |
|
536 |
|
|
|
537 |
# Tests for items not for loan status, bug 24331 |
538 |
my $item_no_type = $builder->build_sample_item({ itype => undef }); |
539 |
lives_ok{ C4::Reserves::IsAvailableForItemLevelRequest($item_no_type, $patron) } "Reserving a book on item level with no itemtype"; |
540 |
my $itemtype_notforloan = $builder->build_object({ class => 'Koha::ItemTypes', value => { notforloan => 1 } })->itemtype; |
541 |
my $item_notforloan = $builder->build_sample_item({ itype => $itemtype_notforloan }); |
542 |
is( C4::Reserves::IsAvailableForItemLevelRequest($item_notforloan, $patron), 0, "Item not available if itemtype notforloan" ); |
543 |
|
536 |
my $pickup_branch = $builder->build({ source => 'Branch' })->{ branchcode }; |
544 |
my $pickup_branch = $builder->build({ source => 'Branch' })->{ branchcode }; |
537 |
t::lib::Mocks::mock_preference( 'UseBranchTransferLimits', '1' ); |
545 |
t::lib::Mocks::mock_preference( 'UseBranchTransferLimits', '1' ); |
538 |
t::lib::Mocks::mock_preference( 'BranchTransferLimitsType', 'itemtype' ); |
546 |
t::lib::Mocks::mock_preference( 'BranchTransferLimitsType', 'itemtype' ); |
539 |
- |
|
|