Example #1
0
 public function testIteratorRewind()
 {
     $testForm = new Form();
     $testElement = $this->getMockBuilder('Vascowhite\\Forms\\Elements\\Text')->disableOriginalConstructor()->getMock();
     $testForm->addElement($testElement);
     $testForm->addElement($testElement);
     $this->assertEquals(0, $testForm->key());
     $testForm->next();
     $this->assertEquals(1, $testForm->key());
     $testForm->rewind();
     $this->assertEquals(0, $testForm->key());
 }