-
-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Orders Staches indexes; uses index order to optimize some sorts
- Loading branch information
1 parent
9770ba2
commit 6dc2217
Showing
12 changed files
with
119 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,10 +34,10 @@ public function users_are_found_using_or_where_in() | |
User::make()->email('[email protected]')->data(['name' => 'Aragorn'])->save(); | ||
User::make()->email('[email protected]')->data(['name' => 'Tommy'])->save(); | ||
|
||
$users = User::query()->whereIn('name', ['Gandalf', 'Frodo'])->orWhereIn('name', ['Gandalf', 'Aragorn', 'Tommy'])->get(); | ||
$users = User::query()->whereIn('name', ['Gandalf', 'Frodo'])->orWhereIn('name', ['Gandalf', 'Aragorn', 'Tommy'])->orderBy('name')->get(); | ||
|
||
$this->assertCount(4, $users); | ||
$this->assertEquals(['Gandalf', 'Frodo', 'Aragorn', 'Tommy'], $users->map->name->all()); | ||
$this->assertEquals(['Aragorn', 'Frodo', 'Gandalf', 'Tommy'], $users->map->name->all()); | ||
} | ||
|
||
/** @test **/ | ||
|
@@ -53,7 +53,7 @@ public function users_are_found_using_or_where_not_in() | |
$users = User::query()->whereNotIn('name', ['Gandalf', 'Frodo'])->orWhereNotIn('name', ['Gandalf', 'Sauron'])->get(); | ||
|
||
$this->assertCount(3, $users); | ||
$this->assertEquals(['Smeagol', 'Aragorn', 'Tommy'], $users->map->name->all()); | ||
$this->assertEquals(['Aragorn', 'Smeagol', 'Tommy'], $users->map->name->all()); | ||
} | ||
|
||
/** @test **/ | ||
|
@@ -119,17 +119,19 @@ public function users_are_found_using_where_with_json_value() | |
|
||
$users = User::query() | ||
->where('content->value', 1) | ||
->orderBy('name') | ||
->get(); | ||
|
||
$this->assertCount(2, $users); | ||
$this->assertEquals(['Gandalf', 'Aragorn'], $users->map->name->all()); | ||
$this->assertEquals(['Aragorn', 'Gandalf'], $users->map->name->all()); | ||
|
||
$users = User::query() | ||
->where('content->value', '<>', 1) | ||
->orderBy('name', 'desc') | ||
->get(); | ||
|
||
$this->assertCount(6, $users); | ||
$this->assertEquals(['Smeagol', 'Frodo', 'Tommy', 'Sauron', 'Arwen', 'Bilbo'], $users->map->name->all()); | ||
$this->assertEquals(['Tommy', 'Smeagol', 'Sauron', 'Frodo', 'Bilbo', 'Arwen'], $users->map->name->all()); | ||
} | ||
|
||
/** @test **/ | ||
|
@@ -225,7 +227,7 @@ public function users_are_found_using_where_group() | |
$userTwo->addToGroup($groupOne)->save(); | ||
$userThree->addToGroup($groupTwo)->save(); | ||
|
||
$users = User::query()->whereGroup('one')->get(); | ||
$users = User::query()->whereGroup('one')->orderBy('name')->get(); | ||
|
||
$this->assertCount(2, $users); | ||
$this->assertEquals(['Gandalf', 'Smeagol'], $users->map->name->all()); | ||
|
@@ -302,7 +304,7 @@ public function users_are_found_using_where_role() | |
$userTwo->assignRole($roleOne)->save(); | ||
$userThree->assignRole($roleTwo)->save(); | ||
|
||
$users = User::query()->whereRole('one')->get(); | ||
$users = User::query()->whereRole('one')->orderBy('name')->get(); | ||
|
||
$this->assertCount(2, $users); | ||
$this->assertEquals(['Gandalf', 'Smeagol'], $users->map->name->all()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters