summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-08-27 21:56:10 +0200
committerGravatar GitHub <noreply@github.com> 2025-08-27 21:56:10 +0200
commit288992d9ad64c52b77983e27f497aa6f4ed5728e (patch)
tree4364722b2efcab1504e5a3dfec9f9f0082513a9d /tests
parent70f0d6d24f217ef4952225f8f57d2f86f7eb96bc (diff)
Fix logic for searching labels (#7863)
`L:1 L:2` is supposed to be an implicit `AND`, while `L:1,2` as well as `L:1 OR L:2` is an `OR` logic
Diffstat (limited to 'tests')
-rw-r--r--tests/app/Models/SearchTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php
index 1e8855aa3..8b4c9d2b5 100644
--- a/tests/app/Models/SearchTest.php
+++ b/tests/app/Models/SearchTest.php
@@ -505,6 +505,17 @@ class SearchTest extends PHPUnit\Framework\TestCase {
'(e.content ~ ? )',
['^(ab|cd)']
],
+ [
+ 'L:1 L:2',
+ '(e.id IN (SELECT et.id_entry FROM `_entrytag` et WHERE et.id_tag IN (?)) AND ' .
+ 'e.id IN (SELECT et.id_entry FROM `_entrytag` et WHERE et.id_tag IN (?)) )',
+ [1, 2]
+ ],
+ [
+ 'L:1,2',
+ '(e.id IN (SELECT et.id_entry FROM `_entrytag` et WHERE et.id_tag IN (?,?)) )',
+ [1, 2]
+ ],
];
}