public function testFactory() { $serviceManager = new ServiceManager(); $pluginManager = new PluginManager(); $pluginManager->setServiceLocator($serviceManager); $serviceManager->setService('ZfcRbac\\Service\\AuthorizationService', $this->getMock('ZfcRbac\\Service\\AuthorizationServiceInterface')); $factory = new IsGrantedPluginFactory(); $isGranted = $factory->createService($pluginManager); $this->assertInstanceOf('ZfcRbac\\Mvc\\Controller\\Plugin\\IsGranted', $isGranted); }
public function testFactory() { $serviceManager = new ServiceManager(); if (method_exists($serviceManager, 'build')) { $this->markTestSkipped('this test is only vor zend-servicemanager v2'); } $pluginManager = new PluginManager($serviceManager); $serviceManager->setService('ZfcRbac\\Service\\AuthorizationService', $this->getMock('ZfcRbac\\Service\\AuthorizationServiceInterface')); $factory = new IsGrantedPluginFactory(); $isGranted = $factory->createService($pluginManager); $this->assertInstanceOf('ZfcRbac\\Mvc\\Controller\\Plugin\\IsGranted', $isGranted); }