From 701bdddee6eeb82426add96e091a815fcf33214f Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 22 Jan 2023 14:14:32 +0900 Subject: [PATCH] test: update tests --- tests/_support/Controllers/Newautorouting.php | 2 +- tests/system/Commands/RoutesTest.php | 2 +- .../Routes/AutoRouterImproved/AutoRouteCollectorTest.php | 4 ++-- .../AutoRouterImproved/ControllerMethodReaderTest.php | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/_support/Controllers/Newautorouting.php b/tests/_support/Controllers/Newautorouting.php index f3c8479f3685..2c31547ed2de 100644 --- a/tests/_support/Controllers/Newautorouting.php +++ b/tests/_support/Controllers/Newautorouting.php @@ -15,7 +15,7 @@ class Newautorouting extends Controller { - public function getIndex() + public function getIndex(string $m = '') { return 'Hello'; } diff --git a/tests/system/Commands/RoutesTest.php b/tests/system/Commands/RoutesTest.php index 6d506274145d..8567dc6bc70a 100644 --- a/tests/system/Commands/RoutesTest.php +++ b/tests/system/Commands/RoutesTest.php @@ -129,7 +129,7 @@ public function testRoutesCommandAutoRouteImproved() | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | - | GET(auto) | newautorouting | | \Tests\Support\Controllers\Newautorouting::getIndex | | toolbar | + | GET(auto) | newautorouting[/..] | | \Tests\Support\Controllers\Newautorouting::getIndex | | toolbar | | POST(auto) | newautorouting/save/../..[/..] | | \Tests\Support\Controllers\Newautorouting::postSave | | toolbar | +------------+--------------------------------+---------------+-----------------------------------------------------+----------------+---------------+ EOL; diff --git a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php index 4b99de7dbb07..72ebc1cf336a 100644 --- a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php +++ b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php @@ -62,7 +62,7 @@ public function testGetFilterMatches() $expected = [ 0 => [ 'GET(auto)', - 'newautorouting', + 'newautorouting[/..]', '', '\\Tests\\Support\\Controllers\\Newautorouting::getIndex', '', @@ -90,7 +90,7 @@ public function testGetFilterDoesNotMatch() $expected = [ 0 => [ 'GET(auto)', - 'newautorouting', + 'newautorouting[/..]', '', '\\Tests\\Support\\Controllers\\Newautorouting::getIndex', '', diff --git a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php index 6a77f0173ab5..6dd81f4722f2 100644 --- a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php +++ b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/ControllerMethodReaderTest.php @@ -43,9 +43,11 @@ public function testRead() 0 => [ 'method' => 'get', 'route' => 'newautorouting', - 'route_params' => '', + 'route_params' => '[/..]', 'handler' => '\Tests\Support\Controllers\Newautorouting::getIndex', - 'params' => [], + 'params' => [ + 'm' => false, + ], ], [ 'method' => 'post',