Skip to content

Commit f540b0d

Browse files
committed
test: add test for route group filter and route filter
1 parent 6ea30bf commit f540b0d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/system/Router/RouteCollectionTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,22 @@ static function ($routes): void {
440440
$this->assertSame($expected, $routes->getRoutesOptions());
441441
}
442442

443+
public function testGroupFilterAndRouteFilter(): void
444+
{
445+
$routes = $this->getCollector();
446+
447+
$routes->group('admin', ['filter' => ['csrf']], static function ($routes): void {
448+
$routes->get('profile', 'Admin\Profile::index', ['filter' => ['honeypot']]);
449+
});
450+
451+
$expected = [
452+
'admin/profile' => [
453+
'filter' => ['csrf', 'honeypot'],
454+
],
455+
];
456+
$this->assertSame($expected, $routes->getRoutesOptions());
457+
}
458+
443459
public function testGroupingWorksWithEmptyStringPrefix(): void
444460
{
445461
$routes = $this->getCollector();

0 commit comments

Comments
 (0)