/**
  * Get a plugin manager populated with fake services to test.
  *
  * @return PluginManager
  */
 protected function getFakePluginManager()
 {
     $pm = new PluginManager();
     foreach (['a', 'b', 'c'] as $name) {
         $pm->setService($name, $this->getMock('VuFind\\Role\\PermissionProvider\\PermissionProviderInterface'));
     }
     return $pm;
 }
 /**
  * Create the supporting plugin manager.
  *
  * @param ServiceLocatorInterface $serviceLocator Service locator
  * @param array                   $rbacConfig     ZfcRbac configuration
  *
  * @return PermissionProviderPluginManager
  */
 protected function getPermissionProviderPluginManager(ServiceLocatorInterface $serviceLocator, array $rbacConfig)
 {
     $pm = new PermissionProvider\PluginManager(new Config($rbacConfig['vufind_permission_provider_manager']));
     $pm->setServiceLocator($serviceLocator->getServiceLocator());
     return $pm;
 }
Example #3
0
 /**
  * Test expected interface.
  *
  * @return void
  *
  * @expectedException        Zend\ServiceManager\Exception\RuntimeException
  * @expectedExceptionMessage Plugin ArrayObject does not belong to VuFind\Role\PermissionProvider\PermissionProviderInterface
  */
 public function testExpectedInterface()
 {
     $pm = new PluginManager(null);
     $pm->validatePlugin(new \ArrayObject());
 }