diff --git a/tests/system/Commands/FilterCheckTest.php b/tests/system/Commands/FilterCheckTest.php index a0b74099f818..65063e5d77e1 100644 --- a/tests/system/Commands/FilterCheckTest.php +++ b/tests/system/Commands/FilterCheckTest.php @@ -45,7 +45,7 @@ public function testFilterCheckDefinedRoute(): void command('filter:check get /'); $this->assertStringContainsString( - '|GET|/||toolbar|', + '|GET|/|||', str_replace(' ', '', $this->getBuffer()) ); } diff --git a/tests/system/Commands/RoutesTest.php b/tests/system/Commands/RoutesTest.php index 9cd24cbe0f6b..92ddb89763fd 100644 --- a/tests/system/Commands/RoutesTest.php +++ b/tests/system/Commands/RoutesTest.php @@ -61,16 +61,16 @@ public function testRoutesCommand(): void +---------+---------+---------------+----------------------------------------+----------------+---------------+ | Method | Route | Name | Handler | Before Filters | After Filters | +---------+---------+---------------+----------------------------------------+----------------+---------------+ - | GET | / | » | \App\Controllers\Home::index | | toolbar | - | GET | closure | » | (Closure) | | toolbar | - | GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | + | GET | / | » | \App\Controllers\Home::index | | | + | GET | closure | » | (Closure) | | | + | GET | testing | testing-index | \App\Controllers\TestController::index | | | + | HEAD | testing | testing-index | \App\Controllers\TestController::index | | | + | POST | testing | testing-index | \App\Controllers\TestController::index | | | + | PUT | testing | testing-index | \App\Controllers\TestController::index | | | + | DELETE | testing | testing-index | \App\Controllers\TestController::index | | | + | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | | + | TRACE | testing | testing-index | \App\Controllers\TestController::index | | | + | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | +---------+---------+---------------+----------------------------------------+----------------+---------------+ EOL; @@ -87,16 +87,16 @@ public function testRoutesCommandSortByHandler(): void +---------+---------+---------------+----------------------------------------+----------------+---------------+ | Method | Route | Name | Handler ↓ | Before Filters | After Filters | +---------+---------+---------------+----------------------------------------+----------------+---------------+ - | GET | closure | » | (Closure) | | toolbar | - | GET | / | » | \App\Controllers\Home::index | | toolbar | - | GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | + | GET | closure | » | (Closure) | | | + | GET | / | » | \App\Controllers\Home::index | | | + | GET | testing | testing-index | \App\Controllers\TestController::index | | | + | HEAD | testing | testing-index | \App\Controllers\TestController::index | | | + | POST | testing | testing-index | \App\Controllers\TestController::index | | | + | PUT | testing | testing-index | \App\Controllers\TestController::index | | | + | DELETE | testing | testing-index | \App\Controllers\TestController::index | | | + | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | | + | TRACE | testing | testing-index | \App\Controllers\TestController::index | | | + | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | +---------+---------+---------------+----------------------------------------+----------------+---------------+ EOL; @@ -114,17 +114,17 @@ public function testRoutesCommandHostHostname() +---------+---------+---------------+----------------------------------------+----------------+---------------+ | Method | Route | Name | Handler | Before Filters | After Filters | +---------+---------+---------------+----------------------------------------+----------------+---------------+ - | GET | / | » | \App\Controllers\Blog::index | | toolbar | - | GET | closure | » | (Closure) | | toolbar | - | GET | all | » | \App\Controllers\AllDomain::index | | toolbar | - | GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | + | GET | / | » | \App\Controllers\Blog::index | | | + | GET | closure | » | (Closure) | | | + | GET | all | » | \App\Controllers\AllDomain::index | | | + | GET | testing | testing-index | \App\Controllers\TestController::index | | | + | HEAD | testing | testing-index | \App\Controllers\TestController::index | | | + | POST | testing | testing-index | \App\Controllers\TestController::index | | | + | PUT | testing | testing-index | \App\Controllers\TestController::index | | | + | DELETE | testing | testing-index | \App\Controllers\TestController::index | | | + | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | | + | TRACE | testing | testing-index | \App\Controllers\TestController::index | | | + | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | +---------+---------+---------------+----------------------------------------+----------------+---------------+ EOL; @@ -142,17 +142,17 @@ public function testRoutesCommandHostSubdomain() +---------+---------+---------------+----------------------------------------+----------------+---------------+ | Method | Route | Name | Handler | Before Filters | After Filters | +---------+---------+---------------+----------------------------------------+----------------+---------------+ - | GET | / | » | \App\Controllers\Sub::index | | toolbar | - | GET | closure | » | (Closure) | | toolbar | - | GET | all | » | \App\Controllers\AllDomain::index | | toolbar | - | GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | + | GET | / | » | \App\Controllers\Sub::index | | | + | GET | closure | » | (Closure) | | | + | GET | all | » | \App\Controllers\AllDomain::index | | | + | GET | testing | testing-index | \App\Controllers\TestController::index | | | + | HEAD | testing | testing-index | \App\Controllers\TestController::index | | | + | POST | testing | testing-index | \App\Controllers\TestController::index | | | + | PUT | testing | testing-index | \App\Controllers\TestController::index | | | + | DELETE | testing | testing-index | \App\Controllers\TestController::index | | | + | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | | + | TRACE | testing | testing-index | \App\Controllers\TestController::index | | | + | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | +---------+---------+---------------+----------------------------------------+----------------+---------------+ EOL; @@ -174,19 +174,19 @@ public function testRoutesCommandAutoRouteImproved(): void +------------+--------------------------------+---------------+-----------------------------------------------------+----------------+---------------+ | Method | Route | Name | Handler | Before Filters | After Filters | +------------+--------------------------------+---------------+-----------------------------------------------------+----------------+---------------+ - | GET | / | » | \App\Controllers\Home::index | | toolbar | - | GET | closure | » | (Closure) | | toolbar | - | GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | + | GET | / | » | \App\Controllers\Home::index | | | + | GET | closure | » | (Closure) | | | + | GET | testing | testing-index | \App\Controllers\TestController::index | | | + | HEAD | testing | testing-index | \App\Controllers\TestController::index | | | + | POST | testing | testing-index | \App\Controllers\TestController::index | | | + | PUT | testing | testing-index | \App\Controllers\TestController::index | | | + | DELETE | testing | testing-index | \App\Controllers\TestController::index | | | + | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | | + | TRACE | testing | testing-index | \App\Controllers\TestController::index | | | + | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | - | GET(auto) | newautorouting[/..] | | \Tests\Support\Controllers\Newautorouting::getIndex | | toolbar | - | POST(auto) | newautorouting/save/../..[/..] | | \Tests\Support\Controllers\Newautorouting::postSave | | toolbar | + | GET(auto) | newautorouting[/..] | | \Tests\Support\Controllers\Newautorouting::getIndex | | | + | POST(auto) | newautorouting/save/../..[/..] | | \Tests\Support\Controllers\Newautorouting::postSave | | | +------------+--------------------------------+---------------+-----------------------------------------------------+----------------+---------------+ EOL; $this->assertStringContainsString($expected, $this->getBuffer()); @@ -205,20 +205,20 @@ public function testRoutesCommandRouteLegacy(): void +---------+------------------+---------------+----------------------------------------+----------------+---------------+ | Method | Route | Name | Handler | Before Filters | After Filters | +---------+------------------+---------------+----------------------------------------+----------------+---------------+ - | GET | / | » | \App\Controllers\Home::index | | toolbar | - | GET | closure | » | (Closure) | | toolbar | - | GET | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | HEAD | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | POST | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | PUT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | DELETE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | TRACE | testing | testing-index | \App\Controllers\TestController::index | | toolbar | - | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | toolbar | + | GET | / | » | \App\Controllers\Home::index | | | + | GET | closure | » | (Closure) | | | + | GET | testing | testing-index | \App\Controllers\TestController::index | | | + | HEAD | testing | testing-index | \App\Controllers\TestController::index | | | + | POST | testing | testing-index | \App\Controllers\TestController::index | | | + | PUT | testing | testing-index | \App\Controllers\TestController::index | | | + | DELETE | testing | testing-index | \App\Controllers\TestController::index | | | + | OPTIONS | testing | testing-index | \App\Controllers\TestController::index | | | + | TRACE | testing | testing-index | \App\Controllers\TestController::index | | | + | CONNECT | testing | testing-index | \App\Controllers\TestController::index | | | | CLI | testing | testing-index | \App\Controllers\TestController::index | | | - | auto | / | | \App\Controllers\Home::index | | toolbar | - | auto | home | | \App\Controllers\Home::index | | toolbar | - | auto | home/index[/...] | | \App\Controllers\Home::index | | toolbar | + | auto | / | | \App\Controllers\Home::index | | | + | auto | home | | \App\Controllers\Home::index | | | + | auto | home/index[/...] | | \App\Controllers\Home::index | | | +---------+------------------+---------------+----------------------------------------+----------------+---------------+ EOL; $this->assertStringContainsString($expected, $this->getBuffer()); diff --git a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php index e705dad48869..3b502f328efc 100644 --- a/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php +++ b/tests/system/Commands/Utilities/Routes/AutoRouterImproved/AutoRouteCollectorTest.php @@ -66,7 +66,7 @@ public function testGetFilterMatches(): void '', '\\Tests\\Support\\Controllers\\Newautorouting::getIndex', '', - 'toolbar', + '', ], 1 => [ 'POST(auto)', @@ -74,7 +74,7 @@ public function testGetFilterMatches(): void '', '\\Tests\\Support\\Controllers\\Newautorouting::postSave', 'honeypot', - 'toolbar', + '', ], ]; $this->assertSame($expected, $routes); @@ -94,7 +94,7 @@ public function testGetFilterDoesNotMatch(): void '', '\\Tests\\Support\\Controllers\\Newautorouting::getIndex', '', - 'toolbar', + '', ], 1 => [ 'POST(auto)', @@ -102,7 +102,7 @@ public function testGetFilterDoesNotMatch(): void '', '\\Tests\\Support\\Controllers\\Newautorouting::postSave', '', - 'toolbar', + '', ], ]; $this->assertSame($expected, $routes); diff --git a/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php b/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php index 1363d468a49d..14e9c37819e9 100644 --- a/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php +++ b/tests/system/Commands/Utilities/Routes/FilterCollectorTest.php @@ -36,7 +36,6 @@ public function testGet(): void 'before' => [ ], 'after' => [ - 'toolbar', ], ]; $this->assertSame($expected, $filters); diff --git a/tests/system/Test/FilterTestTraitTest.php b/tests/system/Test/FilterTestTraitTest.php index e2d5a423637f..cea4140e2a4b 100644 --- a/tests/system/Test/FilterTestTraitTest.php +++ b/tests/system/Test/FilterTestTraitTest.php @@ -38,6 +38,7 @@ protected function setUp(): void // Apply the Custom Filter $this->filtersConfig->aliases['test-customfilter'] = Customfilter::class; $this->filtersConfig->globals['before'] = ['test-customfilter']; + $this->filtersConfig->globals['after'] = ['secureheaders']; } public function testDidRunTraitSetUp(): void @@ -82,7 +83,7 @@ public function testGetFiltersForRoute(): void public function testAssertFilter(): void { $this->assertFilter('/', 'before', 'test-customfilter'); - $this->assertFilter('/', 'after', 'toolbar'); + $this->assertFilter('/', 'after', 'secureheaders'); } public function testAssertNotFilter(): void