/** * Tests the zip() method * * @return void */ public function testZip() { $collection = new Collection([1, 2]); $zipped = $collection->zip([3, 4]); $this->assertEquals([[1, 3], [2, 4]], $zipped->toList()); $collection = new Collection([1, 2]); $zipped = $collection->zip([3]); $this->assertEquals([[1, 3]], $zipped->toList()); $collection = new Collection([1, 2]); $zipped = $collection->zip([3, 4], [5, 6], [7, 8], [9, 10, 11]); $this->assertEquals([[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]], $zipped->toList()); }