Skip to content

Commit

Permalink
Test alternative syntaxes for whole day searches
Browse files Browse the repository at this point in the history
This is make sure that the following TicketSQLs are equal:

    Created = '2018-10-05'
    Created >= '2018-10-05' and Created < '2018-10-06'
  • Loading branch information
sunnavy committed Dec 1, 2023
1 parent ec4b8a0 commit 877940f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions t/ticket/search.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 877940f

Please sign in to comment.