Beispiel #1
0
 /**
  * Returns the next page of the currently selected one or NULL if there is no next page
  *
  * @return \TYPO3\Form\Core\Model\Page
  * @api
  */
 public function getNextPage()
 {
     $nextPageIndex = $this->currentPage->getIndex() + 1;
     if ($this->formDefinition->hasPageWithIndex($nextPageIndex)) {
         return $this->formDefinition->getPageByIndex($nextPageIndex);
     }
 }
Beispiel #2
0
 /**
  * @test
  */
 public function createPageCreatesPageAndAddsItToForm()
 {
     $formDefinition = new FormDefinition('myForm', array('formElementTypes' => array('TYPO3.Form:Form' => array(), 'TYPO3.Form:Page' => array('implementationClassName' => 'TYPO3\\Form\\Core\\Model\\Page'))));
     $page = $formDefinition->createPage('myPage');
     $this->assertSame('myPage', $page->getIdentifier());
     $this->assertSame($page, $formDefinition->getPageByIndex(0));
     $this->assertSame(0, $page->getIndex());
 }