/** * @test */ public function reduceでかけ算する() { $collection = new Collection([1, 2, 3, 4, 5]); $actual = $collection->reduce(function ($carry, $item) { return $carry * $item; }, 1); $this->assertSame(120, $actual); }