Bug 36567: Get rid of Datetime warning in Circulation.t and dateexpiry.t
Running either t/db_dependent/Circulation.t or t/db_dependent/Circulation/dateexpiry.t cause following error to be dispalyed: You are creating a DateTime object with a far future year (9999) and a time zone (Europe/Helsinki). If the time zone you specified has future DST changes this will be very slow. Smallest allowed value is 4999, so we need to use that rather than 9999 in tests. To test prove t/db_dependent/Circulation.t and t/db_dependent/Circulation/dateexpiry.t. Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> (cherry picked from commitf5e9f9634f) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> (cherry picked from commit6302ec6200) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
103c50172f
commit
188ff949df
|
|
@ -2185,8 +2185,8 @@ subtest 'AddIssue & illrequests.due_date' => sub {
|
|||
|
||||
set_userenv($library);
|
||||
|
||||
my $custom_date_due = '9999-12-18 12:34:56';
|
||||
my $expected_date_due = '9999-12-18 23:59:00';
|
||||
my $custom_date_due = '4999-12-18 12:34:56';
|
||||
my $expected_date_due = '4999-12-18 23:59:00';
|
||||
my $illrequest = Koha::Illrequest->new({
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
biblio_id => $item->biblionumber,
|
||||
|
|
@ -2199,8 +2199,8 @@ subtest 'AddIssue & illrequests.due_date' => sub {
|
|||
|
||||
$patron = $builder->build_object( { class => 'Koha::Patrons' } );
|
||||
$item = $builder->build_sample_item();
|
||||
$custom_date_due = '9999-12-19';
|
||||
$expected_date_due = '9999-12-19 23:59:00';
|
||||
$custom_date_due = '4999-12-19';
|
||||
$expected_date_due = '4999-12-19 23:59:00';
|
||||
$illrequest = Koha::Illrequest->new({
|
||||
borrowernumber => $patron->borrowernumber,
|
||||
biblio_id => $item->biblionumber,
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ sub calc_date_due {
|
|||
is( ref $d eq "DateTime" && $d->mdy() =~ /^\d+/, 1, "CalcDateDue with expiry tomorrow" );
|
||||
|
||||
# fourth test far future
|
||||
$patron->{dateexpiry} = '9876-12-31';
|
||||
$patron->dateexpiry('4999-12-31')->store;
|
||||
my $t1 = time;
|
||||
$d = C4::Circulation::CalcDateDue( $today, $item->effective_itemtype, $branch->{branchcode}, $patron );
|
||||
my $t2 = time;
|
||||
|
|
|
|||
Loading…
Reference in New Issue