|
Lines 329-347
subtest 'delete' => sub {
Link Here
|
| 329 |
$builder->build_object({ class => 'Koha::CirculationRules', value => { |
329 |
$builder->build_object({ class => 'Koha::CirculationRules', value => { |
| 330 |
categorycode => $category->categorycode, |
330 |
categorycode => $category->categorycode, |
| 331 |
itemtype => $itemtype->itemtype, |
331 |
itemtype => $itemtype->itemtype, |
| 332 |
branchcode => $library->branchcode |
332 |
branchcode => $library->branchcode, |
|
|
333 |
rule_name => 'maxissueqty', |
| 333 |
} |
334 |
} |
| 334 |
}); |
335 |
}); |
| 335 |
$builder->build_object({ class => 'Koha::CirculationRules', value => { |
336 |
$builder->build_object({ class => 'Koha::CirculationRules', value => { |
| 336 |
categorycode => $category->categorycode, |
337 |
categorycode => $category->categorycode, |
| 337 |
itemtype => $itemtype->itemtype, |
338 |
itemtype => $itemtype->itemtype, |
| 338 |
branchcode => $library->branchcode |
339 |
branchcode => $library->branchcode, |
|
|
340 |
rule_name => 'maxonsiteissueqty', |
| 341 |
} |
| 342 |
}); |
| 343 |
$builder->build_object({ class => 'Koha::CirculationRules', value => { |
| 344 |
categorycode => $category->categorycode, |
| 345 |
itemtype => $itemtype->itemtype, |
| 346 |
branchcode => $library->branchcode, |
| 347 |
rule_name => 'another_rule', # That must not be deleted |
| 339 |
} |
348 |
} |
| 340 |
}); |
349 |
}); |
| 341 |
|
350 |
|
| 342 |
# Now we delete the issuing rule |
351 |
# Now we delete the issuing rule |
| 343 |
$issue_rule->delete; |
352 |
$issue_rule->delete; |
| 344 |
is( Koha::CirculationRules->search()->count ,$count, "We remove related circ rules with our issuing rule"); |
353 |
is( Koha::CirculationRules->search()->count ,$count + 1, "We remove related circ rules maxissueqty and maxonsiteissueqty with our issuing rule"); |
| 345 |
|
354 |
|
| 346 |
}; |
355 |
}; |
| 347 |
|
356 |
|
| 348 |
- |
|
|