/** * By design, the root request will always be an HTTP request because it is * the only of the two types which can be instantiated without having to pass * another request as the parent request. * * @test */ public function anHttpRequestOrActionRequestIsRequiredAsParentRequest() { $httpRequest = HttpRequest::create(new Uri('http://robertlemke.com/blog')); $actionRequest = new ActionRequest($httpRequest); $this->assertSame($httpRequest, $actionRequest->getParentRequest()); $anotherActionRequest = new ActionRequest($actionRequest); $this->assertSame($actionRequest, $anotherActionRequest->getParentRequest()); }
/** * Get the path of the argument namespaces of all parent requests. * Example: mainrequest.subrequest.subsubrequest * * @param \TYPO3\FLOW3\Mvc\ActionRequest $request * @return string */ protected function getRequestNamespacePath($request) { if (!$request instanceof \TYPO3\FLOW3\Http\Request) { $parentPath = $this->getRequestNamespacePath($request->getParentRequest()); return $parentPath . ($parentPath !== '' && $request->getArgumentNamespace() !== '' ? '.' : '') . $request->getArgumentNamespace(); } else { return ''; } }