File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,14 @@ public function keyword(string $value): static
173173 return $ this ->where (ImapSearchKey::Keyword, $ value );
174174 }
175175
176+ /**
177+ * Add a where "UNKEYWORD" clause to the query.
178+ */
179+ public function unkeyword (string $ value ): static
180+ {
181+ return $ this ->where (ImapSearchKey::Unkeyword, $ value );
182+ }
183+
176184 /**
177185 * Add a where "ON" clause to the query.
178186 */
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ enum ImapSearchKey: string
2626 case Deleted = 'DELETED ' ;
2727 case Flagged = 'FLAGGED ' ;
2828 case Keyword = 'KEYWORD ' ;
29+ case Unkeyword = 'UNKEYWORD ' ;
2930 case Subject = 'SUBJECT ' ;
3031 case Smaller = 'SMALLER ' ;
3132 case Answered = 'ANSWERED ' ;
Original file line number Diff line number Diff line change @@ -300,3 +300,11 @@ function (ImapQueryBuilder $q) {
300300
301301 expect ($ builder ->toImap ())->toBe ('LARGER 1024 SMALLER 1048576 ' );
302302});
303+
304+ test ('compiles KEYWORD condition ' , function () {
305+ expect ((new ImapQueryBuilder )->keyword ('important ' )->toImap ())->toBe ('KEYWORD "important" ' );
306+ });
307+
308+ test ('compiles UNKEYWORD condition ' , function () {
309+ expect ((new ImapQueryBuilder )->unkeyword ('important ' )->toImap ())->toBe ('UNKEYWORD "important" ' );
310+ });
You can’t perform that action at this time.
0 commit comments