/** * @test */ public function popが連想配列の時は最後の要素のvalueを返す事を確認() { $collection = new Collection(['foo' => 1, 'bar' => 3]); $actual = $collection->pop(); $this->assertEquals(3, $actual); }
public function testPopReturnsAndRemovesLastItemInCollection() { $c = new Collection(['foo', 'bar']); $this->assertEquals('bar', $c->pop()); $this->assertEquals('foo', $c->first()); }
/** * {@inheritdoc} */ public function pop() { return $this->collection->pop(); }