Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Fix integration tests for breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jul 19, 2023
1 parent 9d54e0f commit 4290604
Showing 1 changed file with 38 additions and 8 deletions.
46 changes: 38 additions & 8 deletions tests/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,61 @@ public function testAndWhere(): void

public function testLike(): void
{
$users = User::where('name', 'like', '%doe')->get();
$users = User::where('name', 'like', '%Doe')->get();
$this->assertCount(2, $users);

$users = User::where('name', 'like', '%y%')->get();
$this->assertCount(3, $users);
$this->assertCount(2, $users);

$users = User::where('name', 'LIKE', '%y%')->get();
$this->assertCount(3, $users);
$this->assertCount(2, $users);

$users = User::where('name', 'like', 't%')->get();
$users = User::where('name', 'like', 'T%')->get();
$this->assertCount(1, $users);
}

public function testNotLike(): void
{
$users = User::where('name', 'not like', '%doe')->get();
$this->assertCount(7, $users);
$this->assertCount(9, $users);

$users = User::where('name', 'not like', '%y%')->get();
$this->assertCount(6, $users);
$this->assertCount(7, $users);

$users = User::where('name', 'not LIKE', '%y%')->get();
$this->assertCount(6, $users);
$this->assertCount(7, $users);

$users = User::where('name', 'not like', 't%')->get();
$this->assertCount(9, $users);
}

public function testIlike(): void
{
$users = User::where('name', 'ilike', '%doe')->get();
$this->assertCount(2, $users);

$users = User::where('name', 'ilike', '%y%')->get();
$this->assertCount(3, $users);

$users = User::where('name', 'ILIKE', '%y%')->get();
$this->assertCount(3, $users);

$users = User::where('name', 'ilike', 't%')->get();
$this->assertCount(1, $users);
}

public function testNotIlike(): void
{
$users = User::where('name', 'not ilike', '%doe')->get();
$this->assertCount(7, $users);

$users = User::where('name', 'not ilike', '%y%')->get();
$this->assertCount(6, $users);

$users = User::where('name', 'not ILIKE', '%y%')->get();
$this->assertCount(6, $users);

$users = User::where('name', 'not ilike', 't%')->get();
$this->assertCount(8, $users);
}

Expand Down Expand Up @@ -314,7 +344,7 @@ public function testSubQuery(): void

$users = User::where('title', 'user')->where(function ($query) {
$query->where('age', 35)
->orWhere('name', 'like', '%harry%');
->orWhere('name', 'like', '%Harry%');
})
->get();

Expand Down

0 comments on commit 4290604

Please sign in to comment.