From 005daca44970a760e779e6d72c5767dfce13295d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 21 Aug 2020 10:21:35 +0100 Subject: [PATCH] Bug 18501: (follow-up) Use t::lib::Dates::compare in tests --- t/db_dependent/Koha/Items.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t index 6140139c0c..bd2b6b013f 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; -- 2.20.1