Lines 46-52
subtest 'Tests for CalcDateDue related to dateexpiry' => sub {
Link Here
|
46 |
}; |
46 |
}; |
47 |
|
47 |
|
48 |
sub can_book_be_issued { |
48 |
sub can_book_be_issued { |
49 |
my $item = $builder->build( { source => 'Item' } ); |
49 |
my $item = $builder->build( { source => 'Item', value => { biblionumber => $builder->build( { source => 'Biblioitem' } )->{biblionumber} } } ); |
50 |
my $patron = $builder->build_object( |
50 |
my $patron = $builder->build_object( |
51 |
{ class => 'Koha::Patrons', |
51 |
{ class => 'Koha::Patrons', |
52 |
value => { |
52 |
value => { |
Lines 61-67
sub can_book_be_issued {
Link Here
|
61 |
cmp_ok $duration, '<', 1, "CanBookBeIssued should not be take more than 1s if the patron is expired"; |
61 |
cmp_ok $duration, '<', 1, "CanBookBeIssued should not be take more than 1s if the patron is expired"; |
62 |
is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is 9999-*' ); |
62 |
is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is 9999-*' ); |
63 |
|
63 |
|
64 |
$item = $builder->build( { source => 'Item' } ); |
64 |
$item = $builder->build( { source => 'Item', value => { biblionumber => $builder->build( { source => 'Biblioitem' } )->{biblionumber} } } ); |
65 |
$patron = $builder->build_object( |
65 |
$patron = $builder->build_object( |
66 |
{ class => 'Koha::Patrons', |
66 |
{ class => 'Koha::Patrons', |
67 |
value => { |
67 |
value => { |
Lines 74-80
sub can_book_be_issued {
Link Here
|
74 |
is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is not set' ); |
74 |
is( not( exists $issuingimpossible->{EXPIRED} ), 1, 'The patron should not be considered as expired if dateexpiry is not set' ); |
75 |
|
75 |
|
76 |
my $tomorrow = dt_from_string->add_duration( DateTime::Duration->new( days => 1 ) ); |
76 |
my $tomorrow = dt_from_string->add_duration( DateTime::Duration->new( days => 1 ) ); |
77 |
$item = $builder->build( { source => 'Item' } ); |
77 |
$item = $builder->build( { source => 'Item', value => { biblionumber => $builder->build( { source => 'Biblioitem' } )->{biblionumber} } } ); |
78 |
$patron = $builder->build_object( |
78 |
$patron = $builder->build_object( |
79 |
{ class => 'Koha::Patrons', |
79 |
{ class => 'Koha::Patrons', |
80 |
value => { |
80 |
value => { |
81 |
- |
|
|