From: Martin Renvoize Date: Fri, 21 Aug 2020 09:21:35 +0000 (+0100) Subject: Bug 18501: (follow-up) Use t::lib::Dates::compare in tests X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=88ed05d07e02f0e7569b35a121b9cde06f6712ca Bug 18501: (follow-up) Use t::lib::Dates::compare in tests Signed-off-by: Jonathan Druart --- diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index 6140139..bd2b6b0 100644 --- a/t/db_dependent/Koha/Items.t +++ b/t/db_dependent/Koha/Items.t @@ -118,13 +118,15 @@ subtest 'store' => sub { Time::Fake->offset( $yesterday->epoch ); $item->$field(1)->store; $item->get_from_storage; - is($item->$field_on, DateTime::Format::MySQL->format_datetime($yesterday), $field_on . " was set upon first truthy setting"); + is( t::lib::Dates::compare( $item->$field_on, $yesterday ), + 0, $field_on . " was set upon first truthy setting" ); # Update the field to a new 'true' value Time::Fake->offset( $today->epoch ); $item->$field(2)->store; $item->get_from_storage; - is($item->$field_on, DateTime::Format::MySQL->format_datetime($yesterday), $field_on . " was not updated upon second truthy setting"); + is( t::lib::Dates::compare( $item->$field_on, $yesterday ), + 0, $field_on . " was not updated upon second truthy setting" ); # Update the field to a new 'false' value $item->$field(0)->store;