/** * @dataProvider everything */ public function testIterateWillStopAfterReturningFalse(\Pinq\ITraversable $traversable, array $data) { if ($traversable->count() < 3) { return; } $count = 0; $traversable->iterate(function ($value, $key) use(&$count) { $count++; //Must use strict equality if ($count === 1) { return ''; } elseif ($count === 2) { return 0; } elseif ($count === 3) { return false; } }); $this->assertSame($count, 3); }
public function visitCount(Requests\Count $request) { return $this->traversable->count(); }
/** * @dataProvider everything */ public function testThatCountReturnsTheAmountOfElements(\Pinq\ITraversable $traversable, array $data) { $this->assertSame($traversable->count(), count($data)); }