/** * @param Collection $collection * @depends testFilter */ public function testFilterReceivesKey(Collection $collection) { $actual = []; $collection->filter(function ($value, $key) use(&$actual) { $actual[$key] = $value; return true; }); $this->assertSame($collection->toArray(), $actual); }