/** * @test * @dataProvider jumpUrlDefaultValidParametersDataProvider * @param string $hash * @param string $jumpUrl */ public function jumpUrlDefaultTransfersSession($hash, $jumpUrl) { $tsConfig['TSFE.']['jumpUrl_transferSession'] = 1; /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendUserAuthentication $frontendUserMock */ $frontendUserMock = $this->getMock(FrontendUserAuthentication::class); $frontendUserMock->id = 123; $this->tsfe->_set('fe_user', $frontendUserMock); $this->tsfe->expects($this->once())->method('getPagesTSconfig')->will($this->returnValue($tsConfig)); $sessionGetParameter = (strpos($jumpUrl, '?') === false ? '?' : '') . '&FE_SESSION_KEY=123-fc9f825a9af59169895f3bb28267a42f'; $expectedJumpUrl = $jumpUrl . $sessionGetParameter; $this->jumpUrlHandler->expects($this->once())->method('redirect')->with($expectedJumpUrl, HttpUtility::HTTP_STATUS_303); $_GET['jumpurl'] = $jumpUrl; $_GET['juHash'] = $hash; $this->jumpUrlHandler->canHandleCurrentUrl(); $this->jumpUrlHandler->handle(); }
/** * @test */ public function NoNewsFoundConfigurationCallsPageNotFoundHandler() { $mock = $this->getAccessibleMock('Tx_MooxNews_Controller_NewsBaseController', array('dummy')); $this->tsfe->expects($this->once())->method('pageNotFoundAndExit'); $mock->_call('handleNoNewsFoundError', 'pageNotFoundHandler'); }
/** * @test */ public function NoNewsFoundConfigurationCallsPageNotFoundHandler() { $mock = $this->getAccessibleMock('GeorgRinger\\News\\Controller\\NewsBaseController', ['dummy']); $this->tsfe->expects($this->once())->method('pageNotFoundAndExit'); $mock->_call('handleNoNewsFoundError', 'pageNotFoundHandler'); }