Skip to content

Commit

Permalink
Merge branch '5.0/test-whole-day-search-alternatives' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed Dec 4, 2023
2 parents a2cdf8e + ee64fc8 commit eeb33b2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions t/ticket/search.t
Original file line number Diff line number Diff line change
Expand Up @@ -368,5 +368,28 @@ ok($user->UserObj->SetTimezone('Asia/Shanghai'), 'Updated root timezone to +08:0
$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");
is($tix->First->Id, $t1->Id, 'We found the expected ticket');

$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 <");
is($tix->First->Id, $t1->Id, 'We found the expected ticket');

# It's 2018-10-05 00:00 in timezone +08:00
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");
is($tix->First->Id, $t1->Id, 'Found expected ticket ' . $t1->Id);

$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 <");
is($tix->First->Id, $t1->Id, 'Found expected ticket ' . $t1->Id);

$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 eeb33b2

Please sign in to comment.