|
Lines 466-472
subtest 'cancel' => sub {
Link Here
|
| 466 |
my $reserve_id = C4::Reserves::AddReserve($hold_info); |
466 |
my $reserve_id = C4::Reserves::AddReserve($hold_info); |
| 467 |
Koha::Holds->find($reserve_id)->cancel; |
467 |
Koha::Holds->find($reserve_id)->cancel; |
| 468 |
my $number_of_logs = |
468 |
my $number_of_logs = |
| 469 |
$schema->resultset('ActionLog')->search( { module => 'HOLDS', action => 'CANCEL', object => $reserve_id } ) |
469 |
$schema->resultset('ActionLog') |
|
|
470 |
->search( { module => 'HOLDS', action => 'CANCEL', object => $reserve_id } ) |
| 470 |
->count; |
471 |
->count; |
| 471 |
is( $number_of_logs, 0, 'Without HoldsLog, Koha::Hold->cancel should not have logged' ); |
472 |
is( $number_of_logs, 0, 'Without HoldsLog, Koha::Hold->cancel should not have logged' ); |
| 472 |
|
473 |
|
|
Lines 474-480
subtest 'cancel' => sub {
Link Here
|
| 474 |
$reserve_id = C4::Reserves::AddReserve($hold_info); |
475 |
$reserve_id = C4::Reserves::AddReserve($hold_info); |
| 475 |
Koha::Holds->find($reserve_id)->cancel; |
476 |
Koha::Holds->find($reserve_id)->cancel; |
| 476 |
$number_of_logs = |
477 |
$number_of_logs = |
| 477 |
$schema->resultset('ActionLog')->search( { module => 'HOLDS', action => 'CANCEL', object => $reserve_id } ) |
478 |
$schema->resultset('ActionLog') |
|
|
479 |
->search( { module => 'HOLDS', action => 'CANCEL', object => $reserve_id } ) |
| 478 |
->count; |
480 |
->count; |
| 479 |
is( $number_of_logs, 1, 'With HoldsLog, Koha::Hold->cancel should have logged' ); |
481 |
is( $number_of_logs, 1, 'With HoldsLog, Koha::Hold->cancel should have logged' ); |
| 480 |
}; |
482 |
}; |