@@ -108,6 +108,24 @@ public function testOrWhereLike(): void
108
108
);
109
109
}
110
110
111
+ public function testOrWhereNotLike (): void
112
+ {
113
+ $ this ->getConnection ()->unprepared ('CREATE TABLE example (str text) ' );
114
+
115
+ $ queries = $ this ->withQueryLog (function (): void {
116
+ $ this ->getConnection ()->table ('example ' )->orWhereNotLike ('str ' , 'ZsbBUJmR ' )->orWhereNotLike ('str ' , '7Cc1Uf8t ' )->get ();
117
+ $ this ->getConnection ()->table ('example ' )->orWhereNotLike ('str ' , 'OamekKIC ' , true )->orWhereNotLike ('str ' , 'HmC3xURl ' , true )->get ();
118
+ });
119
+ $ this ->assertEquals (
120
+ ['select * from "example" where "str" not ilike ? or "str" not ilike ? ' , 'select * from "example" where "str" not like ? or "str" not like ? ' ],
121
+ array_column ($ queries , 'query ' ),
122
+ );
123
+ $ this ->assertEquals (
124
+ [['ZsbBUJmR ' , '7Cc1Uf8t ' ], ['OamekKIC ' , 'HmC3xURl ' ]],
125
+ array_column ($ queries , 'bindings ' ),
126
+ );
127
+ }
128
+
111
129
public function testOrWhereNotAllValues (): void
112
130
{
113
131
$ this ->getConnection ()->unprepared ('CREATE TABLE example (val text) ' );
@@ -267,6 +285,24 @@ public function testWhereLike(): void
267
285
);
268
286
}
269
287
288
+ public function testWhereNotLike (): void
289
+ {
290
+ $ this ->getConnection ()->unprepared ('CREATE TABLE example (str text) ' );
291
+
292
+ $ queries = $ this ->withQueryLog (function (): void {
293
+ $ this ->getConnection ()->table ('example ' )->whereNotLike ('str ' , 'UkAymQlg ' )->get ();
294
+ $ this ->getConnection ()->table ('example ' )->whereNotLike ('str ' , 'IcuC5Cqz ' , true )->get ();
295
+ });
296
+ $ this ->assertEquals (
297
+ ['select * from "example" where "str" not ilike ? ' , 'select * from "example" where "str" not like ? ' ],
298
+ array_column ($ queries , 'query ' ),
299
+ );
300
+ $ this ->assertEquals (
301
+ [['UkAymQlg ' ], ['IcuC5Cqz ' ]],
302
+ array_column ($ queries , 'bindings ' ),
303
+ );
304
+ }
305
+
270
306
public function testWhereNotAllValues (): void
271
307
{
272
308
$ this ->getConnection ()->unprepared ('CREATE TABLE example (val text) ' );
0 commit comments