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

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
Original file line number Diff line number Diff line change
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.