[Rt-commit] rt branch 5.0/test-whole-day-search-alternatives created. rt-5.0.5-70-g877940fc6e
BPS Git Server
git at git.bestpractical.com
Mon Dec 4 14:27:54 UTC 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/test-whole-day-search-alternatives has been created
at 877940fc6e1ba32633ac66fdb0f50a896a8f96c2 (commit)
- Log -----------------------------------------------------------------
commit 877940fc6e1ba32633ac66fdb0f50a896a8f96c2
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Dec 1 13:53:00 2023 -0500
Test alternative syntaxes for whole day searches
This is make sure that the following TicketSQLs are equal:
Created = '2018-10-05'
Created >= '2018-10-05' and Created < '2018-10-06'
diff --git a/t/ticket/search.t b/t/ticket/search.t
index dd84ff1b1a..9c3775018b 100644
--- a/t/ticket/search.t
+++ b/t/ticket/search.t
@@ -369,4 +369,22 @@ $tix = RT::Tickets->new($user);
$tix->FromSQL('Created = "2018-10-05"');
is($tix->Count, 1, "We found 1 ticket created in 2018-10-05 with user in +08:00 timezone");
+$tix = RT::Tickets->new($user);
+$tix->FromSQL('Created >= "2018-10-05" and Created < "2018-10-06"');
+is($tix->Count, 1, "We found 1 ticket created on 2018-10-05 with user in +08:00 timezone using >= and <");
+
+ok($t1->__Set(Field => 'Created', Value => '2018-10-04 16:00:00'), 'Updated t1 Created to 2018-10-04 16:00:00');
+
+$tix = RT::Tickets->new($user);
+$tix->FromSQL('Created = "2018-10-05"');
+is($tix->Count, 1, "We found 1 ticket created in 2018-10-05 with user in +08:00 timezone");
+
+$tix = RT::Tickets->new($user);
+$tix->FromSQL('Created >= "2018-10-05" and Created < "2018-10-06"');
+is($tix->Count, 1, "We found 1 ticket created on 2018-10-05 with user in +08:00 timezone using >= and <");
+
+$tix = RT::Tickets->new($user);
+$tix->FromSQL('Created > "2018-10-05" and Created < "2018-10-06"');
+is($tix->Count, 0, "We found 0 tickets created on 2018-10-05 but not at 00:00:00 with user in +08:00 timezone");
+
done_testing;
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list