Skip to content

Commit

Permalink
feat: add is lazy test for multiply collection method
Browse files Browse the repository at this point in the history
  • Loading branch information
lmottasin committed Jul 4, 2024
1 parent 980e8d5 commit e6a97b1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/Support/SupportLazyCollectionIsLazyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ public function testConcatIsLazy()
$this->assertEnumerations(1, $secondEnumerations);
}

public function testMultiplyIsLazy()
{
$this->assertDoesNotEnumerate(function ($collection) {
$collection->multiply(2);
});

$this->assertEnumeratesCollectionOnce(
$this->make([1, 2,3]),
function ($collection) {
return $collection->multiply(3)->all();
}
);
}

public function testContainsIsLazy()
{
$this->assertEnumerates(5, function ($collection) {
Expand Down

0 comments on commit e6a97b1

Please sign in to comment.