Skip to content

Commit

Permalink
Added test for sole().
Browse files Browse the repository at this point in the history
  • Loading branch information
ash-jc-allen committed Apr 19, 2021
1 parent 483e43b commit 4e76b91
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Support/SupportLazyCollectionIsLazyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,17 @@ public function testSomeIsLazy()
});
}

public function testSoleIsLazy()
{
$data = $this->make([['a' => 1], ['a' => 2], ['a' => 3]]);

$this->assertEnumeratesCollection($data, 3, function ($collection) {
$collection->sole(function ($item) {
return $item['a'] === 2;
});
});
}

public function testSortIsLazy()
{
$this->assertDoesNotEnumerate(function ($collection) {
Expand Down

0 comments on commit 4e76b91

Please sign in to comment.