Skip to content

Commit

Permalink
test: fixed and improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 5, 2014
1 parent 421e81f commit b9ada7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
21 changes: 17 additions & 4 deletions tests/Application.Routers/Route.urlEncoding.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/Route.inc';


$route = new Route('<param>', array(
$route = new Route('<param .*>', 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('<param .*>', 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');
5 changes: 4 additions & 1 deletion tests/Application.Routers/Route.utf8Param.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/');

0 comments on commit b9ada7c

Please sign in to comment.