Lines 1739-1745
subtest "CanBookBeRenewed | bookings" => sub {
Link Here
|
1739 |
my $schema = Koha::Database->schema; |
1739 |
my $schema = Koha::Database->schema; |
1740 |
$schema->storage->txn_begin; |
1740 |
$schema->storage->txn_begin; |
1741 |
|
1741 |
|
1742 |
t::lib::Mocks::mock_preference('RenewalPeriodBase', 'date_due'); |
1742 |
t::lib::Mocks::mock_preference( 'RenewalPeriodBase', 'date_due' ); |
1743 |
|
1743 |
|
1744 |
my $renewing_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
1744 |
my $renewing_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
1745 |
my $booked_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
1745 |
my $booked_patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
Lines 1763-1769
subtest "CanBookBeRenewed | bookings" => sub {
Link Here
|
1763 |
|
1763 |
|
1764 |
# Proposed renewal would encroach on booking |
1764 |
# Proposed renewal would encroach on booking |
1765 |
my ( $renewok, $error ) = CanBookBeRenewed( $renewing_patron, $issue, 0 ); |
1765 |
my ( $renewok, $error ) = CanBookBeRenewed( $renewing_patron, $issue, 0 ); |
1766 |
is( $renewok, 0, "Renewal not allowed as it would mean the item was not returned before the next booking" ); |
1766 |
is( $renewok, 0, "Renewal not allowed as it would mean the item was not returned before the next booking" ); |
1767 |
is( $error, 'booked', "Error is 'booked'" ); |
1767 |
is( $error, 'booked', "Error is 'booked'" ); |
1768 |
|
1768 |
|
1769 |
$schema->storage->txn_rollback; |
1769 |
$schema->storage->txn_rollback; |
1770 |
- |
|
|