| Total Complexity | 1 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class RouteCollectionTest extends TestCase |
||
| 11 | { |
||
| 12 | public function testAddRouteWithDuplicateName(): void |
||
| 13 | { |
||
| 14 | $listRoute = Route::get('/')->name('my-route'); |
||
| 15 | $viewRoute = Route::get('/{id}')->name('my-route'); |
||
| 16 | |||
| 17 | $group = Group::create(); |
||
| 18 | $group->addRoute($listRoute); |
||
| 19 | $group->addRoute($viewRoute); |
||
| 20 | $this->expectExceptionMessage("A route with name 'my-route' already exists."); |
||
| 21 | $routeCollection = new RouteCollection($group); |
||
| 22 | $routeCollection->getRoutes(); |
||
| 23 | } |
||
| 25 |