summaryrefslogtreecommitdiff
path: root/tests/units/UrlHelperTest.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-12 10:38:42 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-12 10:38:42 -0400
commitbc98748c0d5b1e1c4d08f16b58db8aea9b5fb5ce (patch)
treeb8eca28ff1546fe21f5d0ebb48f93e4b5988d92b /tests/units/UrlHelperTest.php
parent7e94d0ca233d15d6124c0adf3f956a119c82ccae (diff)
Start to implement url rewrite (nice urls)
Diffstat (limited to 'tests/units/UrlHelperTest.php')
-rw-r--r--tests/units/UrlHelperTest.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/units/UrlHelperTest.php b/tests/units/UrlHelperTest.php
index 3ef3402a..ebfe9c99 100644
--- a/tests/units/UrlHelperTest.php
+++ b/tests/units/UrlHelperTest.php
@@ -34,6 +34,22 @@ class UrlHelperTest extends Base
);
}
+ 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());
+ }
+
public function testServer()
{
$h = new Url($this->container);
@@ -57,11 +73,13 @@ class UrlHelperTest extends Base
$_SERVER['SERVER_NAME'] = 'kb';
$_SERVER['SERVER_PORT'] = 1234;
+ $h = new Url($this->container);
$this->assertEquals('http://kb:1234/', $h->base());
$c = new Config($this->container);
$c->save(array('application_url' => 'https://mykanboard/'));
+ $h = new Url($this->container);
$this->assertEquals('https://mykanboard/', $c->get('application_url'));
$this->assertEquals('https://mykanboard/', $h->base());
}