Example #1
0
 public function testShift()
 {
     $col = new Collection();
     $this->assertNull($col->shift(), 'shift() returns null on an empty collection');
     $data = array('bar1', 'bar2', 'bar3');
     $col = new Collection($data);
     $this->assertEquals('bar1', $col->shift(), 'shift() returns the first element of the collection');
     $this->assertEquals(array('bar2', 'bar3'), $col->getData(), 'shift() removes the first element of the collection');
 }