Lines 8-14
use C4::Items;
Link Here
|
8 |
use Koha::Items; |
8 |
use Koha::Items; |
9 |
use Koha::CirculationRules; |
9 |
use Koha::CirculationRules; |
10 |
|
10 |
|
11 |
use Test::More tests => 12; |
11 |
use Test::More tests => 13; |
12 |
|
12 |
|
13 |
use t::lib::TestBuilder; |
13 |
use t::lib::TestBuilder; |
14 |
use t::lib::Mocks; |
14 |
use t::lib::Mocks; |
Lines 424-429
subtest 'Check item checkout availability with ordered item' => sub {
Link Here
|
424 |
is( $is, 0, "Ordered item cannot be checked out" ); |
424 |
is( $is, 0, "Ordered item cannot be checked out" ); |
425 |
}; |
425 |
}; |
426 |
|
426 |
|
|
|
427 |
subtest 'Check item availability for hold with ordered item' => sub { |
428 |
plan tests => 1; |
429 |
|
430 |
my $biblio2 = $builder->build_sample_biblio( { itemtype => $itemtype } ); |
431 |
my $item1 = $builder->build_sample_item( |
432 |
{ biblionumber => $biblio2->biblionumber, |
433 |
itype => $itemtype2, |
434 |
homebranch => $library_A, |
435 |
holdingbranch => $library_A, |
436 |
notforloan => -1 |
437 |
} |
438 |
); |
439 |
|
440 |
$dbh->do("DELETE FROM circulation_rules"); |
441 |
Koha::CirculationRules->set_rules( |
442 |
{ categorycode => undef, |
443 |
itemtype => $itemtype2, |
444 |
branchcode => undef, |
445 |
rules => { |
446 |
issuelength => 7, |
447 |
lengthunit => 8, |
448 |
reservesallowed => 99, |
449 |
holds_per_record => 99, |
450 |
onshelfholds => 2, |
451 |
} |
452 |
} |
453 |
); |
454 |
|
455 |
$is = IsAvailableForItemLevelRequest( $item1, $patron1 ); |
456 |
is( $is, 1, "Ordered items are available for hold" ); |
457 |
}; |
458 |
|
459 |
|
427 |
# Cleanup |
460 |
# Cleanup |
428 |
$schema->storage->txn_rollback; |
461 |
$schema->storage->txn_rollback; |
429 |
|
462 |
|
430 |
- |
|
|