Lines 56-62
is( $retrieved_category_1->checkprevcheckout, 'inherit', 'Koha::Patron::Category
Link Here
|
56 |
is( $retrieved_category_2->checkprevcheckout, 'inherit', 'Koha::Patron::Category->store should default checkprevcheckout to inherit' ); |
56 |
is( $retrieved_category_2->checkprevcheckout, 'inherit', 'Koha::Patron::Category->store should default checkprevcheckout to inherit' ); |
57 |
|
57 |
|
58 |
subtest 'get_expiry_date' => sub { |
58 |
subtest 'get_expiry_date' => sub { |
59 |
plan tests => 4; |
59 |
plan tests => 5; |
60 |
my $next_month = dt_from_string->add( months => 1 ); |
60 |
my $next_month = dt_from_string->add( months => 1 ); |
61 |
my $next_year = dt_from_string->add( months => 12 ); |
61 |
my $next_year = dt_from_string->add( months => 12 ); |
62 |
my $yesterday = dt_from_string->add( days => -1 ); |
62 |
my $yesterday = dt_from_string->add( days => -1 ); |
Lines 73-78
subtest 'get_expiry_date' => sub {
Link Here
|
73 |
$category->enrolmentperiod( 12 )->store; |
73 |
$category->enrolmentperiod( 12 )->store; |
74 |
is( $category->get_expiry_date, $next_year, 'With enrolmentperiod defined and no parameter, ->get_expiry_date should return today + enrolmentperiod' ); |
74 |
is( $category->get_expiry_date, $next_year, 'With enrolmentperiod defined and no parameter, ->get_expiry_date should return today + enrolmentperiod' ); |
75 |
is( $category->get_expiry_date( $yesterday ), $next_year->clone->add( days => -1 ), 'With enrolmentperiod defined and a date given in parameter, ->get_expiry_date should take this date + enrolmentperiod' ); |
75 |
is( $category->get_expiry_date( $yesterday ), $next_year->clone->add( days => -1 ), 'With enrolmentperiod defined and a date given in parameter, ->get_expiry_date should take this date + enrolmentperiod' ); |
|
|
76 |
|
77 |
my $hardcoded_date = '2000-01-31'; |
78 |
is( $category->get_expiry_date( $hardcoded_date ), dt_from_string( $hardcoded_date )->add( months => 12 ), 'get_expiry_date accepts strings as well' ); |
79 |
|
76 |
$category->delete; |
80 |
$category->delete; |
77 |
}; |
81 |
}; |
78 |
|
82 |
|
79 |
- |
|
|