|
Lines 20-26
Link Here
|
| 20 |
|
20 |
|
| 21 |
use Modern::Perl; |
21 |
use Modern::Perl; |
| 22 |
|
22 |
|
| 23 |
use Test::More tests => 14; |
23 |
use Test::More tests => 15; |
| 24 |
|
24 |
|
| 25 |
use t::lib::TestBuilder; |
25 |
use t::lib::TestBuilder; |
| 26 |
use t::lib::Mocks; |
26 |
use t::lib::Mocks; |
|
Lines 315-318
subtest renew_all => sub {
Link Here
|
| 315 |
isnt( $transaction->{screen_msg}, 'Invalid patron password.', "Empty password succeeds" ); |
315 |
isnt( $transaction->{screen_msg}, 'Invalid patron password.', "Empty password succeeds" ); |
| 316 |
}; |
316 |
}; |
| 317 |
|
317 |
|
|
|
318 |
subtest renew => sub { |
| 319 |
plan tests => 2; |
| 320 |
|
| 321 |
my $library = $builder->build_object ({ class => 'Koha::Libraries' }); |
| 322 |
my $patron = $builder->build_object( |
| 323 |
{ |
| 324 |
class => 'Koha::Patrons', |
| 325 |
value => { |
| 326 |
branchcode => $library->branchcode, |
| 327 |
} |
| 328 |
} |
| 329 |
); |
| 330 |
t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); |
| 331 |
|
| 332 |
my $item = $builder->build_sample_item({ |
| 333 |
library => $library->branchcode, |
| 334 |
}); |
| 335 |
|
| 336 |
AddIssue( $patron->unblessed, $item->barcode, undef, 0 ); |
| 337 |
my $checkout = $item->checkout; |
| 338 |
ok( defined($checkout), "Successfully checked out an item prior to renewal"); |
| 339 |
|
| 340 |
my $ils = C4::SIP::ILS->new({ id => $library->branchcode }); |
| 341 |
|
| 342 |
my $transaction = $ils->renew( $patron->cardnumber, "", $item->barcode ); |
| 343 |
|
| 344 |
is( $transaction->{renewal_ok}, 1, "Renewal succeeded" ); |
| 345 |
|
| 346 |
}; |
| 347 |
|
| 318 |
$schema->storage->txn_rollback; |
348 |
$schema->storage->txn_rollback; |
| 319 |
- |
|
|