Skip to content

Commit

Permalink
Added a unit test where getNamedRoute failes if declared within a Rou…
Browse files Browse the repository at this point in the history
…teGroup
  • Loading branch information
Fredrik Sundblom committed May 20, 2021
1 parent 7c85d2c commit edf5cf4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/RouteGroupTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,22 @@ public function testGroupAddsStrategyToRoute(): void

$group();
}

public function testGroupWithNamedRoutes(): void
{
$router = new Router();
$name = 'route';
$expected = null;

$router->group('/acme', function (RouteGroup $group) use ($name, &$expected) {
$expected = $group->get('/route', function () {
})
->setName($name);
});

$actual = $router->getNamedRoute($name);

$this->assertNotNull($actual);
$this->assertSame($expected, $actual);
}
}

0 comments on commit edf5cf4

Please sign in to comment.