/**
  * @test
  */
 public function handleResetsTheCancelParameterIfItWasTrue()
 {
     $mockComponent1 = $this->getMockBuilder(\TYPO3\Flow\Http\Component\ComponentInterface::class)->getMock();
     $this->mockComponentContext->expects($this->at(0))->method('getParameter')->with(\TYPO3\Flow\Http\Component\ComponentChain::class, 'cancel')->will($this->returnValue(true));
     $this->mockComponentContext->expects($this->at(1))->method('setParameter')->with(\TYPO3\Flow\Http\Component\ComponentChain::class, 'cancel', null);
     $options = array('components' => array($mockComponent1));
     $this->componentChain = new ComponentChain($options);
     $this->componentChain->handle($this->mockComponentContext);
 }
 /**
  * Handles a HTTP request
  *
  * @return void
  */
 public function handleRequest()
 {
     // Create the request very early so the Resource Management has a chance to grab it:
     $this->request = Request::createFromEnvironment();
     $this->response = new Response();
     $this->boot();
     $this->resolveDependencies();
     if (isset($this->settings['http']['baseUri'])) {
         $this->request->setBaseUri(new Uri($this->settings['http']['baseUri']));
     }
     $componentContext = new ComponentContext($this->request, $this->response);
     $this->baseComponentChain->handle($componentContext);
     $this->response->send();
     $this->bootstrap->shutdown(Bootstrap::RUNLEVEL_RUNTIME);
     $this->exit->__invoke();
 }