public function testDir() { $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/kanboard/index.php', 'REQUEST_METHOD' => 'GET')); $h = new Url($this->container); $this->assertEquals('/kanboard/', $h->dir()); $this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_METHOD' => 'GET')); $h = new Url($this->container); $this->assertEquals('/', $h->dir()); }
public function testDir() { $h = new Url($this->container); $this->assertEquals('', $h->dir()); $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['PHP_SELF'] = '/plop/index.php'; $h = new Url($this->container); $this->assertEquals('/plop/', $h->dir()); $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['PHP_SELF'] = ''; $h = new Url($this->container); $this->assertEquals('/', $h->dir()); }