Example #1
0
 public function testGetLast()
 {
     $col = new Collection();
     $this->assertNull($col->getLast(), 'getLast() returns null on an empty collection');
     $data = array('bar1', 'bar2', 'bar3');
     $col = new Collection($data);
     $this->assertEquals('bar3', $col->getLast(), 'getLast() returns the last element');
     $this->assertEquals('bar3', $col->getCurrent(), 'getLast() moves the internal pointer to the last element');
 }