Example #1
0
 /**
  * @test
  */
 public function createFromEnvironmentWithEmptyServerVariableWorks()
 {
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     $_FILES = array();
     $_SERVER = array();
     $request = Request::createFromEnvironment();
     $this->assertEquals('http://localhost/', (string) $request->getUri());
 }
Example #2
0
 /**
  * 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();
     $this->request->injectSettings($this->settings);
     $this->router->setRoutesConfiguration($this->routesConfiguration);
     $actionRequest = $this->router->route($this->request);
     $this->securityContext->injectRequest($actionRequest);
     $this->dispatcher->dispatch($actionRequest, $this->response);
     $this->response->makeStandardsCompliant($this->request);
     $this->response->send();
     $this->bootstrap->shutdown('Runtime');
     $this->exit->__invoke();
 }