Lines 365-371
subtest 'apply() tests' => sub {
Link Here
|
365 |
my $module = new Test::MockModule('C4::Circulation'); |
365 |
my $module = new Test::MockModule('C4::Circulation'); |
366 |
$module->mock('AddRenewal', sub { $called = 1; }); |
366 |
$module->mock('AddRenewal', sub { $called = 1; }); |
367 |
my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' }); |
367 |
my $credit_renew = $account->add_credit({ amount => 100, user_id => $patron->id, interface => 'commandline' }); |
368 |
my $debits_renew = Koha::Account::Lines->search({ accountlines_id => $accountline->id }); |
368 |
my $debits_renew = Koha::Account::Lines->search({ accountlines_id => $accountline->id })->as_list; |
369 |
$credit_renew->apply( { debits => $debits_renew, offset_type => 'Manual Credit' } ); |
369 |
$credit_renew->apply( { debits => $debits_renew, offset_type => 'Manual Credit' } ); |
370 |
|
370 |
|
371 |
is( $called, 1, 'RenewAccruingItemWhenPaid causes C4::Circulation::AddRenew to be called when appropriate' ); |
371 |
is( $called, 1, 'RenewAccruingItemWhenPaid causes C4::Circulation::AddRenew to be called when appropriate' ); |
372 |
- |
|
|