markTestSkipped('this test is only vor zend-servicemanager v3'); } $creationOptions = [ 'route' => 'permission' ]; $options = new ModuleOptions([ 'identity_provider' => 'LmcRbacMvc\Identity\AuthenticationProvider', 'guards' => [ 'LmcRbacMvc\Guard\ControllerPermissionsGuard' => $creationOptions ], 'protection_policy' => GuardInterface::POLICY_ALLOW, ]); $serviceManager->setService('LmcRbacMvc\Options\ModuleOptions', $options); $serviceManager->setService( 'LmcRbacMvc\Service\AuthorizationService', $this->getMockBuilder('LmcRbacMvc\Service\AuthorizationService')->disableOriginalConstructor()->getMock() ); $factory = new ControllerPermissionsGuardFactory(); $guard = $factory($serviceManager, GuardPluginManager::class); $this->assertInstanceOf('LmcRbacMvc\Guard\ControllerPermissionsGuard', $guard); $this->assertEquals(GuardInterface::POLICY_ALLOW, $guard->getProtectionPolicy()); } }