Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use utf8; |
19 |
use utf8; |
20 |
|
20 |
|
21 |
use Test::More tests => 60; |
21 |
use Test::More tests => 61; |
22 |
use Test::Exception; |
22 |
use Test::Exception; |
23 |
use Test::MockModule; |
23 |
use Test::MockModule; |
24 |
use Test::Deep qw( cmp_deeply ); |
24 |
use Test::Deep qw( cmp_deeply ); |
Lines 4369-4374
subtest 'AddRenewal and AddIssuingCharge tests' => sub {
Link Here
|
4369 |
|
4369 |
|
4370 |
}; |
4370 |
}; |
4371 |
|
4371 |
|
|
|
4372 |
subtest 'AddRenewal() adds to renewals' => sub { |
4373 |
plan tests => 4; |
4374 |
|
4375 |
my $library = $builder->build_object({ class => 'Koha::Libraries' }); |
4376 |
my $patron = $builder->build_object({ |
4377 |
class => 'Koha::Patrons', |
4378 |
value => { branchcode => $library->id } |
4379 |
}); |
4380 |
|
4381 |
my $item = $builder->build_sample_item(); |
4382 |
|
4383 |
set_userenv( $library->unblessed ); |
4384 |
|
4385 |
# Check the item out |
4386 |
my $issue = AddIssue( $patron->unblessed, $item->barcode ); |
4387 |
is(ref($issue), 'Koha::Checkout', 'Issue added'); |
4388 |
|
4389 |
# Renew item |
4390 |
my $duedate = AddRenewal( $patron->id, $item->id, $library->id ); |
4391 |
|
4392 |
ok( $duedate, "Renewal added" ); |
4393 |
|
4394 |
my $renewals = Koha::Checkouts::Renewals->search({ checkout_id => $issue->issue_id }); |
4395 |
is($renewals->count, 1, 'One renewal added'); |
4396 |
my $THE_renewal = $renewals->next; |
4397 |
is( $THE_renewal->renewer_id, C4::Context->userenv->{'number'}, 'Renewer recorded from context' ); |
4398 |
}; |
4399 |
|
4372 |
subtest 'ProcessOfflinePayment() tests' => sub { |
4400 |
subtest 'ProcessOfflinePayment() tests' => sub { |
4373 |
|
4401 |
|
4374 |
plan tests => 4; |
4402 |
plan tests => 4; |
4375 |
- |
|
|