createService() public method

{@inheritDoc}
public createService ( Zend\ServiceManager\ServiceLocatorInterface $serviceLocator )
$serviceLocator Zend\ServiceManager\ServiceLocatorInterface
 public function testFactory()
 {
     $unauthorizedStrategyOptions = $this->getMock('ZfcRbac\\Options\\UnauthorizedStrategyOptions');
     $moduleOptionsMock = $this->getMock('ZfcRbac\\Options\\ModuleOptions');
     $moduleOptionsMock->expects($this->once())->method('getUnauthorizedStrategy')->will($this->returnValue($unauthorizedStrategyOptions));
     $serviceLocatorMock = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface');
     $serviceLocatorMock->expects($this->once())->method('get')->with('ZfcRbac\\Options\\ModuleOptions')->will($this->returnValue($moduleOptionsMock));
     $factory = new UnauthorizedStrategyFactory();
     $unauthorizedStrategy = $factory->createService($serviceLocatorMock);
     $this->assertInstanceOf('ZfcRbac\\View\\Strategy\\UnauthorizedStrategy', $unauthorizedStrategy);
 }
 public function testFactory()
 {
     $unauthorizedStrategyOptions = $this->getMock('ZfcRbac\\Options\\UnauthorizedStrategyOptions');
     $moduleOptionsMock = $this->getMock('ZfcRbac\\Options\\ModuleOptions');
     $moduleOptionsMock->expects($this->once())->method('getUnauthorizedStrategy')->will($this->returnValue($unauthorizedStrategyOptions));
     $serviceLocatorMock = $this->prophesize('Zend\\ServiceManager\\ServiceLocatorInterface');
     $serviceLocatorMock->willImplement(ContainerInterface::class);
     $serviceLocatorMock->get('ZfcRbac\\Options\\ModuleOptions')->willReturn($moduleOptionsMock)->shouldBeCalled();
     $factory = new UnauthorizedStrategyFactory();
     $unauthorizedStrategy = $factory->createService($serviceLocatorMock->reveal());
     $this->assertInstanceOf('ZfcRbac\\View\\Strategy\\UnauthorizedStrategy', $unauthorizedStrategy);
 }