markTestSkipped('this test is only vor zend-servicemanager v3'); } $options = new ModuleOptions([ 'identity_provider' => 'LmcRbacMvc\Identity\AuthenticationProvider', 'guards' => [ 'LmcRbacMvc\Guard\ControllerGuard' => [ 'controller' => 'MyController', 'actions' => 'edit', 'roles' => 'member' ] ], 'protection_policy' => GuardInterface::POLICY_ALLOW ]); $serviceManager->setService('LmcRbacMvc\Options\ModuleOptions', $options); $serviceManager->setService( 'LmcRbacMvc\Service\RoleService', $this->getMockBuilder('LmcRbacMvc\Service\RoleService')->disableOriginalConstructor()->getMock() ); $factory = new ControllerGuardFactory(); $controllerGuard = $factory($serviceManager, GuardPluginManager::class); $this->assertInstanceOf('LmcRbacMvc\Guard\ControllerGuard', $controllerGuard); $this->assertEquals(GuardInterface::POLICY_ALLOW, $controllerGuard->getProtectionPolicy()); } }