| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function testGetRoles() |
||
| 12 | { |
||
| 13 | $secured_routes = ['route_foo', 'route_bar']; |
||
| 14 | $routeToRoleConverter = $this->createMock(RouteToRoleConverter::class); |
||
| 15 | $routeToRoleConverter |
||
| 16 | ->expects($this->exactly(count($secured_routes))) |
||
| 17 | ->method('generateRoleForRoute') |
||
| 18 | ->will($this->returnCallback(function ($route) { |
||
| 19 | return 'ROLE_'.strtoupper($route); |
||
| 20 | })); |
||
| 21 | $rolesProvider = new RolesProvider($routeToRoleConverter, $secured_routes); |
||
| 22 | $this->assertEquals(['ROLE_ROUTE_FOO', 'ROLE_ROUTE_BAR'], $rolesProvider->getRoles()); |
||
| 23 | } |
||
| 25 |