createMock('LmcRbacMvc\Options\UnauthorizedStrategyOptions'); $moduleOptionsMock = $this->createMock('LmcRbacMvc\Options\ModuleOptions'); $moduleOptionsMock->expects($this->once()) ->method('getUnauthorizedStrategy') ->will($this->returnValue($unauthorizedStrategyOptions)); $serviceLocatorMock = $this->prophesize('Laminas\ServiceManager\ServiceLocatorInterface'); $serviceLocatorMock->willImplement(ContainerInterface::class); $serviceLocatorMock->get('LmcRbacMvc\Options\ModuleOptions')->willReturn($moduleOptionsMock)->shouldBeCalled(); $factory = new UnauthorizedStrategyFactory(); $unauthorizedStrategy = $factory->createService($serviceLocatorMock->reveal()); $this->assertInstanceOf('LmcRbacMvc\View\Strategy\UnauthorizedStrategy', $unauthorizedStrategy); } }