Пример #1
0
 public function testPop()
 {
     $col = new Collection();
     $this->assertNull($col->pop(), 'pop() returns null on an empty collection');
     $data = array('bar1', 'bar2', 'bar3');
     $col = new Collection($data);
     $this->assertEquals('bar3', $col->pop(), 'pop() returns the last element of the collection');
     $this->assertEquals(array('bar1', 'bar2'), $col->getData(), 'pop() removes the last element of the collection');
 }