Skip to content

Commit

Permalink
test: add tests for nested groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Apr 26, 2023
1 parent 868a21c commit 546ab8e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/groups.test.php
Expand Up @@ -82,3 +82,23 @@ class TGroup
'App\\\\Controllers\\\\ExampleController'
))->toBeTruthy();
});

test('route groups support nested groups', function () {
$_SERVER['REQUEST_URI'] = '/group/nested/route';

$rx = new Router;

TGroup::$val = true;

$rx->mount('/group', function () use ($rx) {
$rx->mount('/nested', function () use ($rx) {
$rx->get('/route', function () use ($rx) {
TGroup::$val = false;
});
});
});

$rx->run();

expect(TGroup::$val)->toBe(false);
});

0 comments on commit 546ab8e

Please sign in to comment.