|
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 => 48; |
21 |
use Test::More tests => 46; |
| 22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
| 23 |
use Test::Deep qw( cmp_deeply ); |
23 |
use Test::Deep qw( cmp_deeply ); |
| 24 |
|
24 |
|
|
Lines 1538-1573
subtest "AllowRenewalIfOtherItemsAvailable tests" => sub {
Link Here
|
| 1538 |
is( $renewokay, 0, 'Bug 14337 - Verify the borrower can not renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is enabled but the only available item is notforloan' ); |
1538 |
is( $renewokay, 0, 'Bug 14337 - Verify the borrower can not renew with a hold on the record if AllowRenewalIfOtherItemsAvailable is enabled but the only available item is notforloan' ); |
| 1539 |
}; |
1539 |
}; |
| 1540 |
|
1540 |
|
| 1541 |
{ |
|
|
| 1542 |
# Don't allow renewing onsite checkout |
| 1543 |
my $branch = $library->{branchcode}; |
| 1544 |
|
| 1545 |
#Create another record |
| 1546 |
my $biblio = $builder->build_sample_biblio(); |
| 1547 |
|
| 1548 |
my $item = $builder->build_sample_item( |
| 1549 |
{ |
| 1550 |
biblionumber => $biblio->biblionumber, |
| 1551 |
library => $branch, |
| 1552 |
itype => $itemtype, |
| 1553 |
} |
| 1554 |
); |
| 1555 |
|
| 1556 |
my $borrowernumber = Koha::Patron->new({ |
| 1557 |
firstname => 'fn', |
| 1558 |
surname => 'dn', |
| 1559 |
categorycode => $patron_category->{categorycode}, |
| 1560 |
branchcode => $branch, |
| 1561 |
})->store->borrowernumber; |
| 1562 |
|
| 1563 |
my $borrower = Koha::Patrons->find( $borrowernumber )->unblessed; |
| 1564 |
|
| 1565 |
my $issue = AddIssue( $borrower, $item->barcode, undef, undef, undef, undef, { onsite_checkout => 1 } ); |
| 1566 |
my ( $renewed, $error ) = CanBookBeRenewed( $borrowernumber, $item->itemnumber ); |
| 1567 |
is( $renewed, 0, 'CanBookBeRenewed should not allow to renew on-site checkout' ); |
| 1568 |
is( $error, 'onsite_checkout', 'A correct error code should be returned by CanBookBeRenewed for on-site checkout' ); |
| 1569 |
} |
| 1570 |
|
| 1571 |
{ |
1541 |
{ |
| 1572 |
my $library = $builder->build({ source => 'Branch' }); |
1542 |
my $library = $builder->build({ source => 'Branch' }); |
| 1573 |
|
1543 |
|
| 1574 |
- |
|
|