public function test_getting_array_of_keys() { $coll = new Collection(); $coll->addItem('Test Item', 1); $coll->addItem('Test Item', 2); $actual = $coll->keys(); $expected = array(1, 2); $this->assertEquals($expected, $actual); }
public function __construct(Collection $collection) { $this->collection = $collection; $this->keys = $collection->keys(); }
public function testKeys() { $collection = new Collection(['1', 'b' => '2']); $this->assertSame([0, 'b'], $collection->keys()); }
/** * * @param Collection $collection */ public function __construct(JsonManager $collection) { $this->collection = $collection; $this->keys = $this->collection->keys(); }