Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 69; |
20 |
use Test::More tests => 70; |
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
23 |
|
23 |
|
Lines 2091-2093
subtest 'HOLDDGST tests' => sub {
Link Here
|
2091 |
|
2091 |
|
2092 |
$schema->txn_rollback; |
2092 |
$schema->txn_rollback; |
2093 |
}; |
2093 |
}; |
2094 |
- |
2094 |
|
|
|
2095 |
# FIXME: This shouldn't be needed if the item type was a FK constraint for items |
2096 |
subtest 'CheckReserves() item type tests' => sub { |
2097 |
|
2098 |
plan tests => 1; |
2099 |
|
2100 |
$schema->storage->txn_begin; |
2101 |
|
2102 |
my $item_type_to_delete = $builder->build_object( { class => 'Koha::ItemTypes' } ); |
2103 |
my $non_existent_itype = $item_type_to_delete->itemtype; |
2104 |
$item_type_to_delete->delete; |
2105 |
|
2106 |
t::lib::Mocks::mock_preference( 'TrapHoldsOnOrder', 0 ); |
2107 |
|
2108 |
my $item = $builder->build_sample_item( { itype => $non_existent_itype, notforloan => 0, damaged => 0 } ); |
2109 |
|
2110 |
my ($res) = CheckReserves($item); |
2111 |
is( $res, '', 'No holds on new item' ); |
2112 |
|
2113 |
$schema->storage->txn_rollback; |
2114 |
}; |