-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added getFirstResult and getLastResult
- Loading branch information
Mauro Cassani
committed
Nov 15, 2017
1 parent
c84bd85
commit 87df9bc
Showing
3 changed files
with
69 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,6 +153,38 @@ public function it_should_get_results_with_no_criteria_applied() | |
} | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_should_get_the_first_result_with_no_criteria_applied() | ||
{ | ||
foreach ($this->usersArrays as $array) { | ||
$qb = QueryBuilder::create($array); | ||
|
||
$first = $qb->getFirstResult(); | ||
|
||
$this->assertEquals(1, $first['id']); | ||
$this->assertEquals('Leanne Graham', $first['name']); | ||
$this->assertEquals('[email protected]', $first['email']); | ||
} | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_should_get_the_last_result_with_no_criteria_applied() | ||
{ | ||
foreach ($this->usersArrays as $array) { | ||
$qb = QueryBuilder::create($array); | ||
|
||
$last = $qb->getLastResult(); | ||
|
||
$this->assertEquals(10, $last['id']); | ||
$this->assertEquals('Clementina DuBuque', $last['name']); | ||
$this->assertEquals('[email protected]', $last['email']); | ||
} | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
|