From bc3983e6081be02f4ad3d4f8756885fdc1ff83f3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 25 Oct 2019 15:28:49 +0200 Subject: [PATCH] Bug 23382: Use floating time zone to prevent tests to fail because of DST Today Friday Oct 25th, DST next Sunday => Date math are wrong, 96 hours diff becomes 95. To avoid that we use the floating timezone Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- t/db_dependent/Koha/Charges/Fees.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Koha/Charges/Fees.t b/t/db_dependent/Koha/Charges/Fees.t index b67b552f42..2a7b7e1b09 100644 --- a/t/db_dependent/Koha/Charges/Fees.t +++ b/t/db_dependent/Koha/Charges/Fees.t @@ -90,11 +90,11 @@ my $patron = $builder->build_object( } ); -my $dt = dt_from_string(); -Time::Fake->offset( $dt->epoch ); +my $now = dt_from_string()->set_time_zone('floating'); +Time::Fake->offset( $now->epoch ); -my $dt_from = dt_from_string()->subtract( days => 2 ); -my $dt_to = dt_from_string()->add( days => 4 ); +my $dt_from = $now->clone->subtract( days => 2 ); +my $dt_to = $now->clone->add( days => 4 ); subtest 'new' => sub { plan tests => 9; -- 2.11.0