Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit 546ab8e

Browse files
committed
test: add tests for nested groups
1 parent 868a21c commit 546ab8e

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/groups.test.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,23 @@ class TGroup
8282
'App\\\\Controllers\\\\ExampleController'
8383
))->toBeTruthy();
8484
});
85+
86+
test('route groups support nested groups', function () {
87+
$_SERVER['REQUEST_URI'] = '/group/nested/route';
88+
89+
$rx = new Router;
90+
91+
TGroup::$val = true;
92+
93+
$rx->mount('/group', function () use ($rx) {
94+
$rx->mount('/nested', function () use ($rx) {
95+
$rx->get('/route', function () use ($rx) {
96+
TGroup::$val = false;
97+
});
98+
});
99+
});
100+
101+
$rx->run();
102+
103+
expect(TGroup::$val)->toBe(false);
104+
});

0 commit comments

Comments
 (0)