Skip to content

Commit afd85aa

Browse files
authored
[11.x] Add test testMultiplyIsLazy to ensure LazyCollection's multiply method's lazy behaviour (#52020)
* feat: add is lazy test for multiply collection method * fix: make style-ci happy
1 parent 466987f commit afd85aa

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Support/SupportLazyCollectionIsLazyTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,20 @@ public function testConcatIsLazy()
137137
$this->assertEnumerations(1, $secondEnumerations);
138138
}
139139

140+
public function testMultiplyIsLazy()
141+
{
142+
$this->assertDoesNotEnumerate(function ($collection) {
143+
$collection->multiply(2);
144+
});
145+
146+
$this->assertEnumeratesCollectionOnce(
147+
$this->make([1, 2, 3]),
148+
function ($collection) {
149+
return $collection->multiply(3)->all();
150+
}
151+
);
152+
}
153+
140154
public function testContainsIsLazy()
141155
{
142156
$this->assertEnumerates(5, function ($collection) {

0 commit comments

Comments
 (0)