From b9ada7c091b38d4a90dd27ee705cf1bad4f13d71 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Fri, 5 Sep 2014 23:29:54 +0200 Subject: [PATCH] test: fixed and improved tests --- .../Route.urlEncoding.phpt | 21 +++++++++++++++---- .../Application.Routers/Route.utf8Param.phpt | 5 ++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/tests/Application.Routers/Route.urlEncoding.phpt b/tests/Application.Routers/Route.urlEncoding.phpt index 8fb9a3633..0ba9af97d 100644 --- a/tests/Application.Routers/Route.urlEncoding.phpt +++ b/tests/Application.Routers/Route.urlEncoding.phpt @@ -13,11 +13,24 @@ require __DIR__ . '/../bootstrap.php'; require __DIR__ . '/Route.inc'; -$route = new Route('', array( +$route = new Route('', array( 'presenter' => 'Presenter', )); -testRouteIn($route, '/a%3Ab', 'Presenter', array( - 'param' => 'a:b', +testRouteIn($route, '/a%3A%25%2Fb', 'Presenter', array( + 'param' => 'a:%/b', 'test' => 'testvalue', -), '/a%3Ab?test=testvalue'); +), '/a%3A%25/b?test=testvalue'); + + +$route = new Route('', array( + 'presenter' => 'Presenter', + 'param' => array( + Route::FILTER_OUT => 'rawurlencode', + ), +)); + +testRouteIn($route, '/a%3A%25%2Fb', 'Presenter', array( + 'param' => 'a:%/b', + 'test' => 'testvalue', +), '/a%3A%25%2Fb?test=testvalue'); diff --git a/tests/Application.Routers/Route.utf8Param.phpt b/tests/Application.Routers/Route.utf8Param.phpt index fdf55fc26..3d38f60fa 100644 --- a/tests/Application.Routers/Route.utf8Param.phpt +++ b/tests/Application.Routers/Route.utf8Param.phpt @@ -22,6 +22,9 @@ testRouteIn($route, '/č', 'Default', array( 'test' => 'testvalue', ), '/%C4%8D?test=testvalue'); -testRouteIn($route, '/%C4%8D'); +testRouteIn($route, '/%C4%8D', 'Default', array( + 'param' => 'č', + 'test' => 'testvalue', +), '/%C4%8D?test=testvalue'); testRouteIn($route, '/');