/** * 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); } }
/** * @test */ public function hasPageWithIndexReturnsFalseIfTheSpecifiedIndexDoesNotExist() { $formDefinition = new FormDefinition('foo'); $this->assertFalse($formDefinition->hasPageWithIndex(0)); $page = new Page('bar'); $formDefinition->addPage($page); $this->assertFalse($formDefinition->hasPageWithIndex(1)); }