|
Lines 19-24
use Modern::Perl;
Link Here
|
| 19 |
|
19 |
|
| 20 |
use Test::More tests => 118; |
20 |
use Test::More tests => 118; |
| 21 |
|
21 |
|
|
|
22 |
use Data::Dumper; |
| 22 |
use DateTime; |
23 |
use DateTime; |
| 23 |
use POSIX qw( floor ); |
24 |
use POSIX qw( floor ); |
| 24 |
use t::lib::Mocks; |
25 |
use t::lib::Mocks; |
|
Lines 1741-1747
subtest 'AddReturn + CumulativeRestrictionPeriods' => sub {
Link Here
|
| 1741 |
}; |
1742 |
}; |
| 1742 |
|
1743 |
|
| 1743 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
1744 |
subtest 'AddReturn + suspension_chargeperiod' => sub { |
| 1744 |
plan tests => 14; |
1745 |
plan tests => 21; |
| 1745 |
|
1746 |
|
| 1746 |
my $library = $builder->build( { source => 'Branch' } ); |
1747 |
my $library = $builder->build( { source => 'Branch' } ); |
| 1747 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
1748 |
my $patron = $builder->build( { source => 'Borrower', value => { categorycode => $patron_category->{categorycode} } } ); |
|
Lines 2417-2424
sub test_debarment_on_checkout {
Link Here
|
| 2417 |
my $line_number = $caller[2]; |
2418 |
my $line_number = $caller[2]; |
| 2418 |
AddIssue( $patron, $item->{barcode}, $due_date ); |
2419 |
AddIssue( $patron, $item->{barcode}, $due_date ); |
| 2419 |
|
2420 |
|
| 2420 |
AddReturn( $item->{barcode}, $library->{branchcode}, |
2421 |
my ( undef, $message ) = AddReturn( $item->{barcode}, $library->{branchcode}, |
| 2421 |
undef, undef, $return_date ); |
2422 |
undef, undef, $return_date ); |
|
|
2423 |
is( $message->{WasReturned} && exists $message->{Debarred}, 1, 'AddReturn must have debarred the patron' ) |
| 2424 |
or diag('AddReturn returned message ' . Dumper $message ); |
| 2422 |
my $debarments = Koha::Patron::Debarments::GetDebarments( |
2425 |
my $debarments = Koha::Patron::Debarments::GetDebarments( |
| 2423 |
{ borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); |
2426 |
{ borrowernumber => $patron->{borrowernumber}, type => 'SUSPENSION' } ); |
| 2424 |
is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); |
2427 |
is( scalar(@$debarments), 1, 'Test at line ' . $line_number ); |
| 2425 |
- |
|
|