Пример #1
0
 public function testPrepend()
 {
     $col = new PropelCollection();
     $this->assertEquals(1, $col->prepend('a'), 'prepend() returns 1 on an empty collection');
     $data = array('bar1', 'bar2', 'bar3');
     $col = new PropelCollection($data);
     $this->assertEquals(4, $col->prepend('bar4'), 'prepend() returns the new number of elements in the collection when adding a variable');
     $this->assertEquals(array('bar4', 'bar1', 'bar2', 'bar3'), $col->getData(), 'prepend() adds new element to the beginning of the collection');
 }