Lines 4410-4415
subtest 'AddRenewal and AddIssuingCharge tests' => sub {
Link Here
|
4410 |
|
4410 |
|
4411 |
}; |
4411 |
}; |
4412 |
|
4412 |
|
|
|
4413 |
subtest 'AddRenewal() adds to renewals' => sub { |
4414 |
plan tests => 4; |
4415 |
|
4416 |
my $library = $builder->build_object({ class => 'Koha::Libraries' }); |
4417 |
my $patron = $builder->build_object({ |
4418 |
class => 'Koha::Patrons', |
4419 |
value => { branchcode => $library->id } |
4420 |
}); |
4421 |
|
4422 |
my $item = $builder->build_sample_item(); |
4423 |
|
4424 |
set_userenv( $library->unblessed ); |
4425 |
|
4426 |
# Check the item out |
4427 |
my $issue = AddIssue( $patron->unblessed, $item->barcode ); |
4428 |
is(ref($issue), 'Koha::Checkout', 'Issue added'); |
4429 |
|
4430 |
# Renew item |
4431 |
my $duedate = AddRenewal( $patron->id, $item->id, $library->id ); |
4432 |
|
4433 |
ok( $duedate, "Renewal added" ); |
4434 |
|
4435 |
my $renewals = Koha::Checkouts::Renewals->search({ checkout_id => $issue->issue_id }); |
4436 |
is($renewals->count, 1, 'One renewal added'); |
4437 |
my $THE_renewal = $renewals->next; |
4438 |
is( $THE_renewal->renewer_id, C4::Context->userenv->{'number'}, 'Renewer recorded from context' ); |
4439 |
}; |
4440 |
|
4413 |
subtest 'ProcessOfflinePayment() tests' => sub { |
4441 |
subtest 'ProcessOfflinePayment() tests' => sub { |
4414 |
|
4442 |
|
4415 |
plan tests => 4; |
4443 |
plan tests => 4; |
4416 |
- |
|
|