7 BEGIN{ $ENV{'TZ'} = 'GMT'};
9 use RT::Test tests => 10;
11 my $SUBJECT = "Search test - ".$$;
13 use_ok('RT::Tickets');
14 my $tix = RT::Tickets->new($RT::SystemUser);
15 can_ok($tix, 'FromSQL');
16 $tix->FromSQL('Updated = "2005-08-05" AND Subject = "$SUBJECT"');
18 ok(! $tix->Count, "Searching for tickets updated on a random date finds nothing" . $tix->Count);
20 my $ticket = RT::Ticket->new($RT::SystemUser);
21 $ticket->Create(Queue => 'General', Subject => $SUBJECT);
22 ok ($ticket->id, "We created a ticket");
23 my ($id, $txnid, $txnobj) = $ticket->Comment( Content => 'A comment that happend on 2004-01-01');
25 isa_ok($txnobj, 'RT::Transaction');
27 ok($txnobj->CreatedObj->ISO);
28 my ( $sid,$smsg) = $txnobj->__Set(Field => 'Created', Value => '2005-08-05 20:00:56');
30 is($txnobj->Created,'2005-08-05 20:00:56');
31 is($txnobj->CreatedObj->ISO,'2005-08-05 20:00:56');
33 $tix->FromSQL(qq{Updated = "2005-08-05" AND Subject = "$SUBJECT"});