public function test_record_pluck() { $map = new MapOfCollections(); $map->push(['id' => 5, 'name' => 'Ada', 'age' => 16]); $map->push(['id' => 6, 'name' => 'Bee', 'age' => 12]); $map->push(['id' => 7, 'name' => 'Cam', 'age' => 37]); $this->assertSame([5 => 'Ada', 6 => 'Bee', 7 => 'Cam'], $map->pluck('name', 'id')->toArray()); }
public function test_pluck() { $map = new MapOfCollections([[1, 2, 3], [4, 5, 6], [7, 8, 9]]); $this->assertSame([2, 5, 8], $map->pluck(1)->toArray()); }