Example #1
0
 /**
  * Tests the zipWith() method
  *
  * @return void
  */
 public function testZipWith()
 {
     $collection = new Collection([1, 2]);
     $zipped = $collection->zipWith([3, 4], function ($a, $b) {
         return $a * $b;
     });
     $this->assertEquals([3, 8], $zipped->toList());
     $zipped = $collection->zipWith([3, 4], [5, 6, 7], function () {
         return array_sum(func_get_args());
     });
     $this->assertEquals([9, 12], $zipped->toList());
 }