AwsModule\Factory\AwsFactory::createService PHP Method

createService() public method

{@inheritDoc}
public createService ( Zend\ServiceManager\ServiceLocatorInterface $serviceLocator ) : Sdk
$serviceLocator Zend\ServiceManager\ServiceLocatorInterface
return Aws\Sdk
    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return $this($serviceLocator, AwsSdk::class);
    }

Usage Example

 public function testCanFetchAwsFromServiceManager()
 {
     $serviceLocator = $this->getMock(ServiceLocatorInterface::class);
     $serviceLocator->expects($this->once())->method('get')->with('Config')->willReturn([]);
     $awsFactory = new AwsFactory();
     /** @var $aws AwsSdk */
     $aws = $awsFactory->createService($serviceLocator);
     $this->assertInstanceOf(AwsSdk::class, $aws);
 }
All Usage Examples Of AwsModule\Factory\AwsFactory::createService