Skip to content

Commit 4e76b91

Browse files
committed
Added test for sole().
1 parent 483e43b commit 4e76b91

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Support/SupportLazyCollectionIsLazyTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,17 @@ public function testSomeIsLazy()
977977
});
978978
}
979979

980+
public function testSoleIsLazy()
981+
{
982+
$data = $this->make([['a' => 1], ['a' => 2], ['a' => 3]]);
983+
984+
$this->assertEnumeratesCollection($data, 3, function ($collection) {
985+
$collection->sole(function ($item) {
986+
return $item['a'] === 2;
987+
});
988+
});
989+
}
990+
980991
public function testSortIsLazy()
981992
{
982993
$this->assertDoesNotEnumerate(function ($collection) {

0 commit comments

Comments
 (0)