From 10ff7818d07b31f99687c08d77bd38a4e554139e Mon Sep 17 00:00:00 2001 From: Gregorio Chiko Putra Date: Mon, 4 Sep 2017 11:05:10 +0700 Subject: [PATCH] Fix errors while test route --- _tests/unit/RouterTest.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/_tests/unit/RouterTest.php b/_tests/unit/RouterTest.php index 2464832..fe9d192 100644 --- a/_tests/unit/RouterTest.php +++ b/_tests/unit/RouterTest.php @@ -22,19 +22,19 @@ class RouterTest extends \PHPUnit\Framework\TestCase [ '{controller}/{action}', [], - 'posts/entry', + '/posts/entry', ['controller' => 'posts', 'action' => 'entry'] ], [ '{controller}/{action}/{id:\d+}', [], - 'posts/edit/3', + '/posts/edit/3', ['controller' => 'posts', 'action' => 'edit', 'id' => '3'] ], [ '{action}', ['controller' => 'home'], - 'login', + '/login', ['controller' => 'home'] ] ]; @@ -63,11 +63,7 @@ class RouterTest extends \PHPUnit\Framework\TestCase */ public function dispatchingRouteSuccess($route, $params, $url) { - // $url = 'login'; - $router = new Router(); - - // $router->add('{action}', ['controller' => 'home']); $router->add($route, $params); $this->assertTrue($router->dispatch($url));