[Rt-commit] [svn] r768 - rt/branches/rt-3.1/lib/RT
leira at pallas.eruditorum.org
leira at pallas.eruditorum.org
Wed Apr 28 23:06:26 EDT 2004
Author: leira
Date: Wed Apr 28 23:06:25 2004
New Revision: 768
Modified:
rt/branches/rt-3.1/lib/RT/Tickets_Overlay_SQL.pm
Log:
Added new tests:
- "id = <n> OR HasMember = <n>"
- "Subject LIKE 'foo' OR Content LIKE 'foo'"
Modified: rt/branches/rt-3.1/lib/RT/Tickets_Overlay_SQL.pm
==============================================================================
--- rt/branches/rt-3.1/lib/RT/Tickets_Overlay_SQL.pm (original)
+++ rt/branches/rt-3.1/lib/RT/Tickets_Overlay_SQL.pm Wed Apr 28 23:06:25 2004
@@ -457,8 +457,53 @@
ok ($cols[0] == undef, "We haven't explicitly asked to display anything");
+my (@ids, @expectedids);
+my $t = RT::Ticket->new($RT::SystemUser);
+my $string = 'subject/content SQL test';
+ok( $t->Create(Queue => 'General', Subject => $string), "Ticket Created");
+
+push @ids, $t->Id;
+
+my $Message = MIME::Entity->build(
+ Subject => 'this is my subject',
+ From => 'jesse at example.com',
+ Data => [ $string ],
+ );
+
+ok( $t->Create(Queue => 'General', Subject => 'another ticket', MIMEObj => $Message, MemberOf => $ids[0]), "Ticket Created");
+
+push @ids, $t->Id;
+
+$query = ("Subject LIKE '$string' OR Content LIKE '$string'");
+
+my ($id, $msg) = $tix->FromSQL($query);
+
+ok ($id, $msg);
+
+is ($tix->Count, scalar @ids, "number of returned tickets same as entered");
+
+while (my $tick = $tix->Next) {
+ push @expectedids, $tick->Id;
+}
+
+eq_array(\@ids, \@expectedids);
+
+$query = ("id = $ids[0] OR MemberOf = $ids[0]");
+
+my ($id, $msg) = $tix->FromSQL($query);
+
+ok ($id, $msg);
+
+is ($tix->Count, scalar @ids, "number of returned tickets same as entered");
+
+ at expectedids = undef;
+while (my $tick = $tix->Next) {
+ push @expectedids, $tick->Id;
+}
+
+eq_array(\@ids, \@expectedids);
=end testing
More information about the Rt-commit
mailing list