Example #1
0
 public function testReduce()
 {
     $coll = new Collection(['foo', 'bar', 'baz']);
     $result = $coll->reduce(function ($carry, $item) {
         return $carry . $item;
     });
     $this->assertEquals('foobarbaz', $result);
 }