/**
  * {@inheritDoc}
  * @return RoleProviderPluginManager
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $config = $serviceLocator->get('Config')['zfc_rbac']['role_provider_manager'];
     $pluginManager = new RoleProviderPluginManager(new Config($config));
     $pluginManager->setServiceLocator($serviceLocator);
     return $pluginManager;
 }
 /**
  * This is required due to the fact that the ServiceManager catches ALL exceptions and throws it's own...
  */
 public function testThrowExceptionIfNoObjectManagerNorObjectRepositoryIsSet()
 {
     try {
         $pluginManager = new RoleProviderPluginManager();
         $serviceManager = new ServiceManager();
         $pluginManager->setServiceLocator($serviceManager);
         $pluginManager->get('ZfcRbac\\Role\\ObjectRepositoryRoleProvider', ['role_name_property' => 'name']);
     } catch (ServiceNotCreatedException $smException) {
         while ($e = $smException->getPrevious()) {
             if ($e instanceof RuntimeException) {
                 return true;
             }
         }
     }
     $this->fail('ZfcRbac\\Factory\\ObjectRepositoryRoleProviderFactory::createService() :: ' . 'ZfcRbac\\Exception\\RuntimeException was not found in the previous Exceptions');
 }