summaryrefslogtreecommitdiff
path: root/tests/units/Core/Http
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-04 20:10:34 -0500
committerFrederic Guillot <fred@kanboard.net>2016-03-04 20:10:34 -0500
commit8f3e2b2e5c62a6130f6c8867ab335fb4c1a32c5c (patch)
treece28cdc2dba9c31560ef753ac1b4dc39d567b7a6 /tests/units/Core/Http
parentf32507d423c46e8e9612b5239728e6c617e4cbcb (diff)
Helper refactoring
Diffstat (limited to 'tests/units/Core/Http')
-rw-r--r--tests/units/Core/Http/RouterTest.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/units/Core/Http/RouterTest.php b/tests/units/Core/Http/RouterTest.php
index 0b200ab5..75a3ba4f 100644
--- a/tests/units/Core/Http/RouterTest.php
+++ b/tests/units/Core/Http/RouterTest.php
@@ -40,21 +40,25 @@ namespace {
$this->assertEquals('userImport', $dispatcher->sanitize('userImport', 'default'));
}
- public function testGetPath()
+ public function testGetPathWithFolder()
{
- $dispatcher = new Router($this->container);
-
- $this->container['helper'] = new Helper($this->container);
+ $router = new Router($this->container);
$this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_URI' => '/a/b/c', 'REQUEST_METHOD' => 'GET'));
- $this->assertEquals('a/b/c', $dispatcher->getPath());
+ $this->assertEquals('a/b/c', $router->getPath());
+ }
- $this->container['helper'] = new Helper($this->container);
+ public function testGetPathWithQueryString()
+ {
+ $router = new Router($this->container);
$this->container['request'] = new Request($this->container, array('PHP_SELF' => '/index.php', 'REQUEST_URI' => '/a/b/something?test=a', 'QUERY_STRING' => 'test=a', 'REQUEST_METHOD' => 'GET'));
- $this->assertEquals('a/b/something', $dispatcher->getPath());
+ $this->assertEquals('a/b/something', $router->getPath());
+ }
- $this->container['helper'] = new Helper($this->container);
+ public function testGetPathWithSubFolderAndQueryString()
+ {
+ $router = new Router($this->container);
$this->container['request'] = new Request($this->container, array('PHP_SELF' => '/a/index.php', 'REQUEST_URI' => '/a/b/something?test=a', 'QUERY_STRING' => 'test=a', 'REQUEST_METHOD' => 'GET'));
- $this->assertEquals('b/something', $dispatcher->getPath());
+ $this->assertEquals('b/something', $router->getPath());
}
public function testDispatcherWithControllerNotFound()