/** * @test */ public function isMainRequestChecksIfTheParentRequestIsNotAnHttpRequest() { $anotherActionRequest = new ActionRequest($this->actionRequest); $yetAnotherActionRequest = new ActionRequest($anotherActionRequest); $this->assertTrue($this->actionRequest->isMainRequest()); $this->assertFalse($anotherActionRequest->isMainRequest()); $this->assertFalse($yetAnotherActionRequest->isMainRequest()); }
/** * Get a new RequestMatcher for the Request's ParentRequest * * @return \TYPO3\Flow\Mvc\RequestMatcher * @api */ public function getParentRequest() { if ($this->request === null || $this->request->isMainRequest()) { return new RequestMatcher(); } $this->addWeight(1000000); return new RequestMatcher($this->request->getParentRequest(), $this); }
/** * @test */ public function isMainRequestChecksIfTheParentRequestIsNotAnHttpRequest() { $httpRequest = HttpRequest::create(new Uri('http://robertlemke.com/blog')); $actionRequest = new ActionRequest($httpRequest); $anotherActionRequest = new ActionRequest($actionRequest); $yetAnotherActionRequest = new ActionRequest($anotherActionRequest); $this->assertTrue($actionRequest->isMainRequest()); $this->assertFalse($anotherActionRequest->isMainRequest()); $this->assertFalse($yetAnotherActionRequest->isMainRequest()); }