|
Lines 568-577
subtest 'Renewal related tests' => sub {
Link Here
|
| 568 |
); |
568 |
); |
| 569 |
my $called = 0; |
569 |
my $called = 0; |
| 570 |
my $module = Test::MockModule->new('C4::Circulation'); |
570 |
my $module = Test::MockModule->new('C4::Circulation'); |
| 571 |
$module->mock('AddRenewal', sub { $called = 1; }); |
|
|
| 572 |
$module->mock('CanBookBeRenewed', sub { return 1; }); |
571 |
$module->mock('CanBookBeRenewed', sub { return 1; }); |
| 573 |
$line->renew_item; |
572 |
$line->renew_item; |
| 574 |
is( $called, 1, 'Attempt to renew succeeds when conditions are met' ); |
573 |
my $r = Koha::Checkouts::Renewals->find({ checkout_id => $issue->id }); |
|
|
574 |
is( $r->seen, 0, "RenewAccruingItemWhenPaid triggers an unseen renewal" ); |
| 575 |
|
575 |
|
| 576 |
$schema->storage->txn_rollback; |
576 |
$schema->storage->txn_rollback; |
| 577 |
}; |
577 |
}; |
| 578 |
- |
|
|