ZfcRbac\Factory\IsGrantedViewHelperFactory::createService PHP Method

createService() public method

{@inheritDoc}
public createService ( Zend\ServiceManager\ServiceLocatorInterface $serviceLocator ) : IsGranted
$serviceLocator Zend\ServiceManager\ServiceLocatorInterface
return ZfcRbac\View\Helper\IsGranted
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this($serviceLocator->getServiceLocator(), IsGranted::class);
    }

Usage Example

 public function testFactory()
 {
     $serviceManager = new ServiceManager();
     $pluginManager = new HelperPluginManager();
     $pluginManager->setServiceLocator($serviceManager);
     $serviceManager->setService('ZfcRbac\\Service\\AuthorizationService', $this->getMock('ZfcRbac\\Service\\AuthorizationServiceInterface'));
     $factory = new IsGrantedViewHelperFactory();
     $isGranted = $factory->createService($pluginManager);
     $this->assertInstanceOf('ZfcRbac\\View\\Helper\\IsGranted', $isGranted);
 }
All Usage Examples Of ZfcRbac\Factory\IsGrantedViewHelperFactory::createService
IsGrantedViewHelperFactory