diff --git a/Tests/Role/RolesProviderTest.php b/Tests/Role/RolesProviderTest.php index a414fbf..e1a4ecd 100755 --- a/Tests/Role/RolesProviderTest.php +++ b/Tests/Role/RolesProviderTest.php @@ -13,7 +13,7 @@ public function testGetRoles() $secured_routes = ['route_foo', 'route_bar']; $routeToRoleConverter = $this->createMock(RouteToRoleConverter::class); $routeToRoleConverter - ->expects(new \PHPUnit_Framework_MockObject_Matcher_InvokedCount(count($secured_routes))) + ->expects($this->exactly(count($secured_routes))) ->method('generateRoleForRoute') ->will($this->returnCallback(function ($route) { return 'ROLE_'.strtoupper($route); diff --git a/Tests/Security/AccessControlTest.php b/Tests/Security/AccessControlTest.php index 86c5e48..9199d96 100755 --- a/Tests/Security/AccessControlTest.php +++ b/Tests/Security/AccessControlTest.php @@ -42,6 +42,17 @@ public function testIsRouteSecure() $accessControl = $this->createFreshAccessControl(); $this->assertTrue($accessControl->isRouteSecure('admin_home')); $this->assertFalse($accessControl->isRouteSecure('home_page')); + $this->assertFalse($accessControl->isRouteSecure('api_get_user')); + } + + public function testGetAllSecuredRoutes() + { + $accessControl = $this->createFreshAccessControl(); + $all_secured_routes = $accessControl->getAllSecuredRoutes(); + $this->assertContains('admin_home', $all_secured_routes); + $this->assertContains('admin_dashboard', $all_secured_routes); + $this->assertContains('admin_profile', $all_secured_routes); + $this->assertNotContains('api_get_user', $all_secured_routes); } public function testIsEnable()