We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a636081 + b765e20 commit ec5343fCopy full SHA for ec5343f
tests/FinderTest.php
@@ -271,6 +271,21 @@ public function testLastKeepCurrentOriginalData(): void
271
$this->assertSame(DateTime::class, current($data)::class);
272
}
273
274
+ private function getGenerator(): Generator
275
+ {
276
+ yield 1;
277
+ yield 2;
278
+ yield 3;
279
+ }
280
+
281
+ public function testLastFromGenerator(): void
282
283
+ $generator = $this->getGenerator();
284
+ $filter = static fn(int $datum): bool => $datum > 1;
285
286
+ $this->assertSame(3, Finder::last($generator, $filter));
287
288
289
#[DataProvider('rowsDataProvider')]
290
public function testRows(iterable $data, callable $filter, array $expected): void
291
{
0 commit comments