From 82c06ca56eff260a444e20b2632f55b1bf068979 Mon Sep 17 00:00:00 2001 From: Sebastian Rapetti Date: Sun, 11 Sep 2016 21:46:26 +0200 Subject: [PATCH] RouterTest update --- tests/Http/RouterTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Http/RouterTest.php b/tests/Http/RouterTest.php index 8e363138..228bbcc9 100644 --- a/tests/Http/RouterTest.php +++ b/tests/Http/RouterTest.php @@ -119,4 +119,24 @@ public function testParamRoute() $this->assertEquals('enable', $route->getAction()); $this->assertEquals(array('id'=>'5'), $route->getParam()); } + + public function testRewriteModeOff() + { + //start router + $router = new Router('/index.php?//user/5/enable', $this->routes, array( + 'basePath' => '/', + 'badRoute' => 'E404', + 'rewriteMode' => false + )); + + //get route + $route = $router->getRoute(); + + $this->assertInstanceOf(Route::class, $route); + $this->assertEquals('UserModel', $route->getModel()); + $this->assertEquals('UserView', $route->getView()); + $this->assertEquals('UserController', $route->getController()); + $this->assertEquals('enable', $route->getAction()); + $this->assertEquals(array('id'=>'5'), $route->getParam()); + } } \ No newline at end of file