示例#1
0
 /**
  * Test get URL
  */
 public function testGetUrlWithHttps()
 {
     $env = Slim_Environment::mock(array('HOST' => 'slimframework.com', 'SERVER_NAME' => 'slim', 'SERVER_PORT' => 443, 'slim.url_scheme' => 'https'));
     $req = new Slim_Http_Request($env);
     $this->assertEquals('https://slimframework.com', $req->getUrl());
 }
示例#2
0
 /**
  * Test get URL
  */
 public function testGetUrlWithHttps()
 {
     Slim_Environment::mock(array('REQUEST_METHOD' => 'GET', 'REMOTE_ADDR' => '127.0.0.1', 'SCRIPT_NAME' => '/foo/index.php', 'PATH_INFO' => '/bar/xyz', 'QUERY_STRING' => 'one=1&two=2&three=3', 'SERVER_NAME' => 'slim', 'SERVER_PORT' => 443, 'slim.url_scheme' => 'https', 'slim.input' => '', 'slim.errors' => fopen('php://stderr', 'w'), 'HTTP_HOST' => 'slimframework.com'));
     $env = Slim_Environment::getInstance();
     $req = new Slim_Http_Request($env);
     $this->assertEquals('https://slimframework.com', $req->getUrl());
 }