Skip to content

Commit 4b06d01

Browse files
committed
tests: improved
1 parent b912f96 commit 4b06d01

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

tests/Routers/Route.basic.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ require __DIR__ . '/Route.php';
1717

1818
$route = new Route('<presenter>/<action=default>/<id= \d{1,3}>');
1919

20+
Assert::same([], $route->getConstantParameters());
21+
2022
Assert::same('http://example.com/homepage/', testRouteOut($route, ['presenter' => 'Homepage']));
2123

2224
Assert::same('http://example.com/homepage/', testRouteOut($route, ['presenter' => 'Homepage', 'action' => 'default']));

tests/Routers/Route.extraDefaultParam.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
declare(strict_types=1);
88

99
use Nette\Application\Routers\Route;
10+
use Tester\Assert;
1011

1112

1213
require __DIR__ . '/../bootstrap.php';
@@ -18,6 +19,8 @@ $route = new Route('<presenter>/<action>/<id \d{1,3}>/', [
1819
'extra' => null,
1920
]);
2021

22+
Assert::same(['extra' => null], $route->getConstantParameters());
23+
2124
testRouteIn($route, '/presenter/action/12/any');
2225

2326
testRouteIn($route, '/presenter/action/12', [

tests/Routers/Route.modules.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ $route = new Route('<presenter>', [
1919
'module' => 'Module:Submodule',
2020
]);
2121

22+
Assert::same([], $route->getConstantParameters());
23+
2224
testRouteIn($route, '/abc', [
2325
'presenter' => 'Module:Submodule:Abc',
2426
'test' => 'testvalue',

tests/Routers/Route.optional.module.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
declare(strict_types=1);
88

99
use Nette\Application\Routers\Route;
10+
use Tester\Assert;
1011

1112

1213
require __DIR__ . '/../bootstrap.php';
@@ -20,6 +21,8 @@ $route = new Route('[<module admin|image>/]<presenter>/<action>', [
2021
'action' => 'default',
2122
]);
2223

24+
Assert::same([], $route->getConstantParameters());
25+
2326
testRouteIn($route, '/one', [
2427
'presenter' => 'Front:One',
2528
'action' => 'default',

0 commit comments

Comments
 (0)