From 77119974a4aec75482445ce820c92a1e1397b136 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 24 Nov 2023 07:22:48 +0000 Subject: [PATCH] Bug 35393: Fix Objects.t - filter_by_last_update Content-Type: text/plain; charset=utf-8 Test plan: Keep awake until just after midnight :) Run t/db_dependent/Koha/Objects.t --- t/db_dependent/Koha/Objects.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t index 9891b37896..a868b5c3d0 100755 --- a/t/db_dependent/Koha/Objects.t +++ b/t/db_dependent/Koha/Objects.t @@ -1191,7 +1191,7 @@ subtest "filter_by_last_update" => sub { subtest 'Parameters older_than, younger_than' => sub { my $now = dt_from_string(); my $rs = Koha::Patrons->search( { borrowernumber => { -in => \@borrowernumbers } } ); - $rs->update( { updated_on => $now->clone->subtract( hours => 25 ) } ); + $rs->update( { updated_on => $now->clone->subtract( hours => 24 ) } ); is( $rs->filter_by_last_update( { timestamp_column_name => 'updated_on', from => $now } )->count, 0, 'All updated yesterday' @@ -1208,17 +1208,17 @@ subtest "filter_by_last_update" => sub { ); is( $rs->filter_by_last_update( - { timestamp_column_name => 'updated_on', from => $now->clone->subtract( days => 1 ), } + { timestamp_column_name => 'updated_on', from => $now->clone->subtract( minutes => 24 * 60 - 1 ), } )->count, 0, - 'Yesterday, not truncated, one hour too late' + 'Yesterday + 1m, not truncated, no results' ); is( $rs->filter_by_last_update( - { timestamp_column_name => 'updated_on', from => $now->clone->subtract( hours => 25 ), } + { timestamp_column_name => 'updated_on', from => $now->clone->subtract( hours => 24 ), } )->count, 6, - 'Yesterday - 1h, not truncated, within time frame' + 'Yesterday, not truncated, results' ); }; -- 2.30.2