ZfcRbac\Factory\HasRoleViewHelperFactory::createService PHP Method

createService() public method

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

Usage Example

コード例 #1
0
 public function testFactory()
 {
     $serviceManager = new ServiceManager();
     $pluginManager = new HelperPluginManager();
     $pluginManager->setServiceLocator($serviceManager);
     $serviceManager->setService('ZfcRbac\\Service\\RoleService', $this->getMock('ZfcRbac\\Service\\RoleService', [], [], '', false));
     $factory = new HasRoleViewHelperFactory();
     $viewHelper = $factory->createService($pluginManager);
     $this->assertInstanceOf('ZfcRbac\\View\\Helper\\HasRole', $viewHelper);
 }
All Usage Examples Of ZfcRbac\Factory\HasRoleViewHelperFactory::createService
HasRoleViewHelperFactory