/** * */ public function testStack() { $collection = new Collection($this->collection); $collection->push('test'); $this->assertEquals($collection->all(), ['foo' => 'bar', '123' => 456, 'level1' => ['level2' => ['level3' => 'value']], 124 => 'test']); $this->assertEquals($collection->pull('level1'), ['level2' => ['level3' => 'value']]); $this->assertEquals($collection->all(), ['foo' => 'bar', '123' => 456, 124 => 'test']); $collection->throne('king', 'role'); $this->assertEquals($collection->all(), ['role' => 'king', 'foo' => 'bar', '123' => 456, 124 => 'test']); $this->assertEquals($collection->shift(), 'king'); $pop = $collection->pop(); $this->assertEquals($collection->all(), ['foo' => 'bar', '123' => 456]); $this->assertEquals($pop, 'test'); $collection->airy(); $this->assertEquals($collection->all(), ['foo' => 'bar', '0' => 456]); }