From 88dad6456f1e7ba07c6988b8ec49836489628cd8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 15 Jan 2024 10:35:04 -0300 Subject: [PATCH] Bug 35788: Test for current day booking The implemented tests checked past and future dates for filtering bookings. But `> NOW()` excludes the current date, and this case was not covered. It is now. Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Koha/Bookings.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Bookings.t b/t/db_dependent/Koha/Bookings.t index 19e2e8e37c8..ca409a6123c 100755 --- a/t/db_dependent/Koha/Bookings.t +++ b/t/db_dependent/Koha/Bookings.t @@ -33,7 +33,7 @@ my $builder = t::lib::TestBuilder->new; subtest 'filter_by_future' => sub { - plan tests => 1; + plan tests => 2; $schema->storage->txn_begin; @@ -75,5 +75,18 @@ subtest 'filter_by_future' => sub { is( $biblio->bookings->filter_by_future->count, 2, 'There should have 2 bookings starting after now' ); + $builder->build_object( + { + class => 'Koha::Bookings', + value => { + biblio_id => $biblio->biblionumber, + start_date => dt_from_string->truncate( to => 'day' ), + end_date => undef + } + } + ); + + is( $biblio->bookings->filter_by_future->count, 2, 'Current day is not considered future' ); + $schema->storage->txn_rollback; }; -- 2.43.0