The dispatcher will try to dispatch the request again if it has not been
addressed yet.
public isDispatched ( ) : boolean | ||
Результат | boolean | TRUE if this request has been dispatched successfully |
/** * @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(AbstractController::class, ['processRequest']); $this->inject($controller, 'flashMessageContainer', new FlashMessageContainer()); $this->assertFalse($request->isDispatched()); $controller->_call('initializeController', $request, $this->mockHttpResponse); $this->assertTrue($request->isDispatched()); $this->assertInstanceOf(Arguments::class, $controller->_get('arguments')); $this->assertSame($request, $controller->_get('uriBuilder')->getRequest()); $this->assertSame($request, $controller->getControllerContext()->getRequest()); }