markTestSkipped('this test is only vor zend-servicemanager v3'); } $creationOptions = [ 'route' => 'role' ]; $options = new ModuleOptions([ 'identity_provider' => 'LmcRbacMvc\Identity\AuthenticationProvider', 'guards' => [ 'LmcRbacMvc\Guard\RoutePermissionsGuard' => $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 RoutePermissionsGuardFactory(); $routeGuard = $factory($serviceManager, 'LmcRbacMvc\Guard\RoutePermissionsGuard'); $this->assertInstanceOf('LmcRbacMvc\Guard\RoutePermissionsGuard', $routeGuard); $this->assertEquals(GuardInterface::POLICY_ALLOW, $routeGuard->getProtectionPolicy()); } }