Skip to content

Commit b9ada7c

Browse files
committed
test: fixed and improved tests
1 parent 421e81f commit b9ada7c

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

tests/Application.Routers/Route.urlEncoding.phpt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,24 @@ require __DIR__ . '/../bootstrap.php';
1313
require __DIR__ . '/Route.inc';
1414

1515

16-
$route = new Route('<param>', array(
16+
$route = new Route('<param .*>', array(
1717
'presenter' => 'Presenter',
1818
));
1919

20-
testRouteIn($route, '/a%3Ab', 'Presenter', array(
21-
'param' => 'a:b',
20+
testRouteIn($route, '/a%3A%25%2Fb', 'Presenter', array(
21+
'param' => 'a:%/b',
2222
'test' => 'testvalue',
23-
), '/a%3Ab?test=testvalue');
23+
), '/a%3A%25/b?test=testvalue');
24+
25+
26+
$route = new Route('<param .*>', array(
27+
'presenter' => 'Presenter',
28+
'param' => array(
29+
Route::FILTER_OUT => 'rawurlencode',
30+
),
31+
));
32+
33+
testRouteIn($route, '/a%3A%25%2Fb', 'Presenter', array(
34+
'param' => 'a:%/b',
35+
'test' => 'testvalue',
36+
), '/a%3A%25%2Fb?test=testvalue');

tests/Application.Routers/Route.utf8Param.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ testRouteIn($route, '/č', 'Default', array(
2222
'test' => 'testvalue',
2323
), '/%C4%8D?test=testvalue');
2424

25-
testRouteIn($route, '/%C4%8D');
25+
testRouteIn($route, '/%C4%8D', 'Default', array(
26+
'param' => 'č',
27+
'test' => 'testvalue',
28+
), '/%C4%8D?test=testvalue');
2629

2730
testRouteIn($route, '/');

0 commit comments

Comments
 (0)