/** * @test */ public function cloneResetsTheStatusToNotDispatched() { $this->actionRequest->setDispatched(true); $cloneRequest = clone $this->actionRequest; $this->assertTrue($this->actionRequest->isDispatched()); $this->assertFalse($cloneRequest->isDispatched()); }
/** * @test */ public function initializeControllerInitializesRequestUriBuilderArgumentsAndContext() { $request = new ActionRequest(Request::create(new Uri('http://localhost/foo'))); $controller = $this->getAccessibleMock(\TYPO3\Flow\Mvc\Controller\AbstractController::class, array('processRequest')); $this->inject($controller, 'flashMessageContainer', new FlashMessageContainer()); $this->assertFalse($request->isDispatched()); $controller->_call('initializeController', $request, $this->mockHttpResponse); $this->assertTrue($request->isDispatched()); $this->assertInstanceOf(\TYPO3\Flow\Mvc\Controller\Arguments::class, $controller->_get('arguments')); $this->assertSame($request, $controller->_get('uriBuilder')->getRequest()); $this->assertSame($request, $controller->getControllerContext()->getRequest()); }
/** * @test */ public function cloneResetsTheStatusToNotDispatched() { $httpRequest = HttpRequest::create(new Uri('http://foo.com')); $originalRequest = new ActionRequest($httpRequest); $originalRequest->setDispatched(TRUE); $cloneRequest = clone $originalRequest; $this->assertTrue($originalRequest->isDispatched()); $this->assertFalse($cloneRequest->isDispatched()); }