Beispiel #1
0
 /**
  * Test get [script name, root uri, path, path info, resource uri] in root directory with htaccess
  */
 public function testAppPathsInRootDirectoryWithHtaccess()
 {
     $env = Slim_Environment::mock(array('SCRIPT_NAME' => '', 'PATH_INFO' => '/bar/xyz'));
     $req = new Slim_Http_Request($env);
     $this->assertEquals('', $req->getScriptName());
     $this->assertEquals('', $req->getRootUri());
     $this->assertEquals('/bar/xyz', $req->getPath());
     $this->assertEquals('/bar/xyz', $req->getPathInfo());
     $this->assertEquals('/bar/xyz', $req->getResourceUri());
 }
Beispiel #2
0
 /**
  * Test get [script name, root uri, path, path info, resource uri] in root directory with htaccess
  */
 public function testAppPathsInRootDirectoryWithHtaccess()
 {
     Slim_Environment::mock(array('REQUEST_METHOD' => 'GET', 'REMOTE_ADDR' => '127.0.0.1', 'SCRIPT_NAME' => '', 'PATH_INFO' => '/bar/xyz', 'QUERY_STRING' => 'one=1&two=2&three=3', 'SERVER_NAME' => 'slim', 'SERVER_PORT' => 80, 'slim.url_scheme' => 'http', 'slim.input' => '', 'slim.errors' => fopen('php://stderr', 'w')));
     $env = Slim_Environment::getInstance();
     $req = new Slim_Http_Request($env);
     $this->assertEquals('', $req->getScriptName());
     $this->assertEquals('', $req->getRootUri());
     $this->assertEquals('/bar/xyz', $req->getPath());
     $this->assertEquals('/bar/xyz', $req->getPathInfo());
     $this->assertEquals('/bar/xyz', $req->getResourceUri());
 }