Lines 1264-1270
subtest 'store check barcodes' => sub {
Link Here
|
1264 |
}; |
1264 |
}; |
1265 |
|
1265 |
|
1266 |
subtest 'deletion' => sub { |
1266 |
subtest 'deletion' => sub { |
1267 |
plan tests => 16; |
1267 |
plan tests => 18; |
1268 |
|
1268 |
|
1269 |
$schema->storage->txn_begin; |
1269 |
$schema->storage->txn_begin; |
1270 |
|
1270 |
|
Lines 1345-1350
subtest 'deletion' => sub {
Link Here
|
1345 |
'IndependentBranches prevents deletion at another branch', |
1345 |
'IndependentBranches prevents deletion at another branch', |
1346 |
); |
1346 |
); |
1347 |
|
1347 |
|
|
|
1348 |
# item_has_holds |
1349 |
my $item_level_hold = $builder->build_object( |
1350 |
{ |
1351 |
class => 'Koha::Holds', |
1352 |
value => { |
1353 |
biblionumber => $item->biblionumber, |
1354 |
itemnumber => $item->itemnumber, |
1355 |
found => undef, |
1356 |
} |
1357 |
} |
1358 |
); |
1359 |
|
1360 |
$item->discard_changes; |
1361 |
my $safe_to_delete = $item->safe_to_delete; |
1362 |
ok( !$safe_to_delete, 'Cannot delete item with item level holds' ); |
1363 |
is( |
1364 |
@{ $safe_to_delete->messages }[0]->message, |
1365 |
'item_has_holds', |
1366 |
'Koha::Item->safe_to_delete reports item has item level holds', |
1367 |
); |
1368 |
|
1369 |
$item_level_hold->delete; |
1370 |
|
1348 |
# linked_analytics |
1371 |
# linked_analytics |
1349 |
|
1372 |
|
1350 |
{ # codeblock to limit scope of $module->mock |
1373 |
{ # codeblock to limit scope of $module->mock |
Lines 2852-2858
subtest 'store() tests' => sub {
Link Here
|
2852 |
{ |
2875 |
{ |
2853 |
borrowernumber => $patron->id, |
2876 |
borrowernumber => $patron->id, |
2854 |
date => '1970-01-01 14:00:01', |
2877 |
date => '1970-01-01 14:00:01', |
2855 |
amountoutstanding => 0, |
2878 |
amountoutstanding => 0, |
2856 |
amount => -5, |
2879 |
amount => -5, |
2857 |
interface => 'commandline', |
2880 |
interface => 'commandline', |
2858 |
credit_type_code => 'PAYMENT' |
2881 |
credit_type_code => 'PAYMENT' |