/**
  * @dataProvider controllerDataProvider
  */
 public function testControllerGranted(array $rules, $controller, $action, $identityPermissions, $isGranted, $protectionPolicy)
 {
     $routeMatch = new RouteMatch([]);
     $routeMatch->setParam('controller', $controller);
     $routeMatch->setParam('action', $action);
     $authorizationService = $this->getMockAuthorizationService();
     $authorizationService->expects($this->any())->method('isGranted')->will($this->returnValueMap($identityPermissions));
     $controllerGuard = new ControllerPermissionsGuard($authorizationService, $rules);
     $controllerGuard->setProtectionPolicy($protectionPolicy);
     $event = new MvcEvent();
     $event->setRouteMatch($routeMatch);
     $this->assertEquals($isGranted, $controllerGuard->isGranted($event));
 }