|
4 | 4 |
|
5 | 5 | namespace Tpetry\PostgresqlEnhanced\Tests\Query;
|
6 | 6 |
|
7 |
| -use Illuminate\Support\Facades\App; |
8 | 7 | use Tpetry\PostgresqlEnhanced\Tests\TestCase;
|
9 | 8 |
|
10 | 9 | class WhereTest extends TestCase
|
@@ -99,19 +98,10 @@ public function testOrWhereLike(): void
|
99 | 98 | $this->getConnection()->table('example')->orWhereLike('str', 'ZsbBUJmR')->orWhereLike('str', '7Cc1Uf8t')->get();
|
100 | 99 | $this->getConnection()->table('example')->orWhereLike('str', 'OamekKIC', true)->orWhereLike('str', 'HmC3xURl', true)->get();
|
101 | 100 | });
|
102 |
| - |
103 |
| - if (version_compare(App::version(), '11.17.0', '>=')) { |
104 |
| - $this->assertEquals( |
105 |
| - ['select * from "example" where "str"::text ilike ? or "str"::text ilike ?', 'select * from "example" where "str"::text like ? or "str"::text like ?'], |
106 |
| - array_column($queries, 'query'), |
107 |
| - ); |
108 |
| - } else { |
109 |
| - $this->assertEquals( |
110 |
| - ['select * from "example" where "str" ilike ? or "str" ilike ?', 'select * from "example" where "str" like ? or "str" like ?'], |
111 |
| - array_column($queries, 'query'), |
112 |
| - ); |
113 |
| - } |
114 |
| - |
| 101 | + $this->assertEquals( |
| 102 | + ['select * from "example" where "str"::text ilike ? or "str"::text ilike ?', 'select * from "example" where "str"::text like ? or "str"::text like ?'], |
| 103 | + array_column($queries, 'query'), |
| 104 | + ); |
115 | 105 | $this->assertEquals(
|
116 | 106 | [['ZsbBUJmR', '7Cc1Uf8t'], ['OamekKIC', 'HmC3xURl']],
|
117 | 107 | array_column($queries, 'bindings'),
|
@@ -190,19 +180,10 @@ public function testOrWhereNotLike(): void
|
190 | 180 | $this->getConnection()->table('example')->orWhereNotLike('str', 'ZsbBUJmR')->orWhereNotLike('str', '7Cc1Uf8t')->get();
|
191 | 181 | $this->getConnection()->table('example')->orWhereNotLike('str', 'OamekKIC', true)->orWhereNotLike('str', 'HmC3xURl', true)->get();
|
192 | 182 | });
|
193 |
| - |
194 |
| - if (version_compare(App::version(), '11.17.0', '>=')) { |
195 |
| - $this->assertEquals( |
196 |
| - ['select * from "example" where "str"::text not ilike ? or "str"::text not ilike ?', 'select * from "example" where "str"::text not like ? or "str"::text not like ?'], |
197 |
| - array_column($queries, 'query'), |
198 |
| - ); |
199 |
| - } else { |
200 |
| - $this->assertEquals( |
201 |
| - ['select * from "example" where "str" not ilike ? or "str" not ilike ?', 'select * from "example" where "str" not like ? or "str" not like ?'], |
202 |
| - array_column($queries, 'query'), |
203 |
| - ); |
204 |
| - } |
205 |
| - |
| 183 | + $this->assertEquals( |
| 184 | + ['select * from "example" where "str"::text not ilike ? or "str"::text not ilike ?', 'select * from "example" where "str"::text not like ? or "str"::text not like ?'], |
| 185 | + array_column($queries, 'query'), |
| 186 | + ); |
206 | 187 | $this->assertEquals(
|
207 | 188 | [['ZsbBUJmR', '7Cc1Uf8t'], ['OamekKIC', 'HmC3xURl']],
|
208 | 189 | array_column($queries, 'bindings'),
|
@@ -294,19 +275,10 @@ public function testWhereLike(): void
|
294 | 275 | $this->getConnection()->table('example')->whereLike('str', 'UkAymQlg')->get();
|
295 | 276 | $this->getConnection()->table('example')->whereLike('str', 'IcuC5Cqz', true)->get();
|
296 | 277 | });
|
297 |
| - |
298 |
| - if (version_compare(App::version(), '11.17.0', '>=')) { |
299 |
| - $this->assertEquals( |
300 |
| - ['select * from "example" where "str"::text ilike ?', 'select * from "example" where "str"::text like ?'], |
301 |
| - array_column($queries, 'query'), |
302 |
| - ); |
303 |
| - } else { |
304 |
| - $this->assertEquals( |
305 |
| - ['select * from "example" where "str" ilike ?', 'select * from "example" where "str" like ?'], |
306 |
| - array_column($queries, 'query'), |
307 |
| - ); |
308 |
| - } |
309 |
| - |
| 278 | + $this->assertEquals( |
| 279 | + ['select * from "example" where "str"::text ilike ?', 'select * from "example" where "str"::text like ?'], |
| 280 | + array_column($queries, 'query'), |
| 281 | + ); |
310 | 282 | $this->assertEquals(
|
311 | 283 | [['UkAymQlg'], ['IcuC5Cqz']],
|
312 | 284 | array_column($queries, 'bindings'),
|
@@ -385,19 +357,10 @@ public function testWhereNotLike(): void
|
385 | 357 | $this->getConnection()->table('example')->whereNotLike('str', 'UkAymQlg')->get();
|
386 | 358 | $this->getConnection()->table('example')->whereNotLike('str', 'IcuC5Cqz', true)->get();
|
387 | 359 | });
|
388 |
| - |
389 |
| - if (version_compare(App::version(), '11.17.0', '>=')) { |
390 |
| - $this->assertEquals( |
391 |
| - ['select * from "example" where "str"::text not ilike ?', 'select * from "example" where "str"::text not like ?'], |
392 |
| - array_column($queries, 'query'), |
393 |
| - ); |
394 |
| - } else { |
395 |
| - $this->assertEquals( |
396 |
| - ['select * from "example" where "str" not ilike ?', 'select * from "example" where "str" not like ?'], |
397 |
| - array_column($queries, 'query'), |
398 |
| - ); |
399 |
| - } |
400 |
| - |
| 360 | + $this->assertEquals( |
| 361 | + ['select * from "example" where "str"::text not ilike ?', 'select * from "example" where "str"::text not like ?'], |
| 362 | + array_column($queries, 'query'), |
| 363 | + ); |
401 | 364 | $this->assertEquals(
|
402 | 365 | [['UkAymQlg'], ['IcuC5Cqz']],
|
403 | 366 | array_column($queries, 'bindings'),
|
|
0 commit comments