/** * @dataProvider provideCases */ function testCases(array $insert, callable $map, array $expect) { $iterator = new ArrayIterator($insert); $mapped = $iterator->map($map); $this->assertCount(count($expect), $mapped); $this->assertEquals($expect, $mapped->toArray()); }
function testMap() { $iterator = new ArrayIterator([0]); $this->assertInstanceOf('Collections\\MappingIterator', $iterator->map(function () { })); }