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