aboutsummaryrefslogtreecommitdiff
path: root/tests/app/Models/SearchTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/app/Models/SearchTest.php')
-rw-r--r--tests/app/Models/SearchTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php
index 58eb875e0..3092b43ca 100644
--- a/tests/app/Models/SearchTest.php
+++ b/tests/app/Models/SearchTest.php
@@ -296,6 +296,7 @@ class SearchTest extends PHPUnit\Framework\TestCase {
['!ab OR -cd', '(!ab) OR (-cd)'],
['ab cd OR ef OR "gh ij"', '(ab cd) OR (ef) OR ("gh ij")'],
['ab (!cd)', 'ab (!cd)'],
+ ['"ab" (!"cd")', '"ab" (!"cd")'],
];
}
@@ -321,6 +322,7 @@ class SearchTest extends PHPUnit\Framework\TestCase {
['(ab (cd OR ef OR (gh))) OR ij', '(ab ((cd) OR (ef) OR (gh))) OR (ij)'],
['(ab (!cd OR ef OR (gh))) OR ij', '(ab ((!cd) OR (ef) OR (gh))) OR (ij)'],
['(ab !(cd OR ef OR !(gh))) OR ij', '(ab !((cd) OR (ef) OR !(gh))) OR (ij)'],
+ ['"ab" OR (!"cd")', '("ab") OR (!"cd")'],
];
}
@@ -440,6 +442,18 @@ class SearchTest extends PHPUnit\Framework\TestCase {
'OR (((e.title LIKE ? OR e.content LIKE ?) )))) OR NOT (((e.title LIKE ? OR e.content LIKE ?) ) OR ((e.title LIKE ? OR e.content LIKE ?) ))',
['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%', '%gh%', '%gh%', '%ij%', '%ij%', '%kl%', '%kl%'],
],
+ [
+ '"ab" "cd" ("ef") intitle:"gh" !"ij" -"kl"',
+ '(((e.title LIKE ? OR e.content LIKE ?) AND (e.title LIKE ? OR e.content LIKE ?) )) AND (((e.title LIKE ? OR e.content LIKE ?) )) ' .
+ 'AND ((e.title LIKE ? AND e.title NOT LIKE ? AND e.content NOT LIKE ? AND e.title NOT LIKE ? AND e.content NOT LIKE ? ))',
+ ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%', '%gh%', '%ij%', '%ij%', '%kl%', '%kl%']
+ ],
+ [
+ '"ab" "cd" ("ef") intitle:"gh" !"ij" -"kl"',
+ '(((e.title LIKE ? OR e.content LIKE ?) AND (e.title LIKE ? OR e.content LIKE ?) )) AND (((e.title LIKE ? OR e.content LIKE ?) )) ' .
+ 'AND ((e.title LIKE ? AND e.title NOT LIKE ? AND e.content NOT LIKE ? AND e.title NOT LIKE ? AND e.content NOT LIKE ? ))',
+ ['%ab%', '%ab%', '%cd%', '%cd%', '%ef%', '%ef%', '%gh%', '%ij%', '%ij%', '%kl%', '%kl%']
+ ],
];
}