/** * @dataProvider simpleArrayProvider */ public function testReduce(array $array) { $callable = function ($carry, $item) { $carry .= '-' . $item; return $carry; }; $reducedArray = array_reduce($array, $callable, 'array'); $ma = new MutableArray($array); $this->assertTrue($reducedArray === $ma->reduce($callable, 'array')); }