/** * Test get host */ public function testGetHostWhenNotExists() { $env = Slim_Environment::mock(array('SERVER_NAME' => 'slim', 'HOST' => 'slimframework.com')); unset($env['HOST']); $req = new Slim_Http_Request($env); $this->assertEquals('slim', $req->getHost()); //Uses SERVER_NAME as backup }
/** * Test get host */ public function testGetHostWhenNotExists() { $env = Slim_Environment::getInstance(); $req = new Slim_Http_Request($env); $this->assertEquals('slim', $req->getHost()); //Uses SERVER_NAME as backup }