diff options
author | ivan <ivan> | 2009-12-18 00:41:34 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-12-18 00:41:34 +0000 |
commit | 40a7b3dc653e099f7bd0bd762b649b04c4432db2 (patch) | |
tree | f818105b1c8b13d709af4e251ee3213c5ba6773d /rt/lib/t/regression/22search_tix_by_watcher.t | |
parent | 8d0665daac0c4deea67bf39bf4a13a9eaed51735 (diff) | |
parent | 2dfda73eeb3eae2d4f894099754794ef07d060dd (diff) |
This commit was generated by cvs2svn to compensate for changes in r8593,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'rt/lib/t/regression/22search_tix_by_watcher.t')
-rw-r--r-- | rt/lib/t/regression/22search_tix_by_watcher.t | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/rt/lib/t/regression/22search_tix_by_watcher.t b/rt/lib/t/regression/22search_tix_by_watcher.t index 4dd11af1e..204c41c37 100644 --- a/rt/lib/t/regression/22search_tix_by_watcher.t +++ b/rt/lib/t/regression/22search_tix_by_watcher.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 79; +use Test::More tests => 119; use_ok('RT'); RT::LoadConfig(); RT::Init(); @@ -95,6 +95,56 @@ sub run_tests { } run_tests(); +# mixing searches by watchers with other conditions +# http://rt3.fsck.com/Ticket/Display.html?id=9322 +%test = ( + 'Subject LIKE "x" AND Requestor = "y@example.com"' => + { xy => 1, x => 0, y => 0, '-' => 0, z => 0 }, + 'Subject NOT LIKE "x" AND Requestor = "y@example.com"' => + { xy => 0, x => 0, y => 1, '-' => 0, z => 0 }, + 'Subject LIKE "x" AND Requestor != "y@example.com"' => + { xy => 0, x => 1, y => 0, '-' => 0, z => 0 }, + 'Subject NOT LIKE "x" AND Requestor != "y@example.com"' => + { xy => 0, x => 0, y => 0, '-' => 1, z => 1 }, + + 'Subject LIKE "x" OR Requestor = "y@example.com"' => + { xy => 1, x => 1, y => 1, '-' => 0, z => 0 }, + 'Subject NOT LIKE "x" OR Requestor = "y@example.com"' => + { xy => 1, x => 0, y => 1, '-' => 1, z => 1 }, + 'Subject LIKE "x" OR Requestor != "y@example.com"' => + { xy => 1, x => 1, y => 0, '-' => 1, z => 1 }, + 'Subject NOT LIKE "x" OR Requestor != "y@example.com"' => + { xy => 0, x => 1, y => 1, '-' => 1, z => 1 }, + +# group of cases when user doesn't exist in DB at all + 'Subject LIKE "x" AND Requestor = "not-exist@example.com"' => + { xy => 0, x => 0, y => 0, '-' => 0, z => 0 }, + 'Subject NOT LIKE "x" AND Requestor = "not-exist@example.com"' => + { xy => 0, x => 0, y => 0, '-' => 0, z => 0 }, + 'Subject LIKE "x" AND Requestor != "not-exist@example.com"' => + { xy => 1, x => 1, y => 0, '-' => 0, z => 0 }, + 'Subject NOT LIKE "x" AND Requestor != "not-exist@example.com"' => + { xy => 0, x => 0, y => 1, '-' => 1, z => 1 }, + 'Subject LIKE "x" OR Requestor = "not-exist@example.com"' => + { xy => 1, x => 1, y => 0, '-' => 0, z => 0 }, + 'Subject NOT LIKE "x" OR Requestor = "not-exist@example.com"' => + { xy => 0, x => 0, y => 1, '-' => 1, z => 1 }, + 'Subject LIKE "x" OR Requestor != "not-exist@example.com"' => + { xy => 1, x => 1, y => 1, '-' => 1, z => 1 }, + 'Subject NOT LIKE "x" OR Requestor != "not-exist@example.com"' => + { xy => 1, x => 1, y => 1, '-' => 1, z => 1 }, + + 'Subject LIKE "z" AND (Requestor = "x@example.com" OR Requestor = "y@example.com")' => + { xy => 0, x => 0, y => 0, '-' => 0, z => 0 }, + 'Subject NOT LIKE "z" AND (Requestor = "x@example.com" OR Requestor = "y@example.com")' => + { xy => 1, x => 1, y => 1, '-' => 0, z => 0 }, + 'Subject LIKE "z" OR (Requestor = "x@example.com" OR Requestor = "y@example.com")' => + { xy => 1, x => 1, y => 1, '-' => 0, z => 1 }, + 'Subject NOT LIKE "z" OR (Requestor = "x@example.com" OR Requestor = "y@example.com")' => + { xy => 1, x => 1, y => 1, '-' => 1, z => 0 }, +); +run_tests(); + TODO: { local $TODO = "we can't generate this query yet"; %test = ( @@ -142,6 +192,7 @@ TODO: { } run_tests(); + # owner is special watcher because reference is duplicated in two places, # owner was an ENUM field now it's WATCHERFIELD, but should support old # style ENUM searches for backward compatibility |