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