/**
  * @covers Aws\Common\Client\DefaultClient::factory
  */
 public function testFactoryInitializesClient()
 {
     $credentials = $this->getMock('Aws\\Common\\Credentials\\CredentialsInterface');
     $client = DefaultClient::factory(array(Options::CREDENTIALS => $credentials, Options::SERVICE_DESCRIPTION => __DIR__ . '/../../../../../src/Aws/Sts/Resources/sts-2011-06-15.php'));
     $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureInterface', $client->getSignature());
     $this->assertInstanceOf('Aws\\Common\\Credentials\\CredentialsInterface', $client->getCredentials());
     $this->assertSame($credentials, $client->getCredentials());
     $this->assertEquals('https://sts.amazonaws.com', $client->getBaseUrl());
 }
 /**
  * @covers Aws\Common\Client\DefaultClient::factory
  */
 public function testFactoryInitializesClient()
 {
     $signature = $this->getMock('Aws\\Common\\Signature\\SignatureInterface');
     $credentials = $this->getMock('Aws\\Common\\Credentials\\CredentialsInterface');
     $client = DefaultClient::factory(array(Options::CREDENTIALS => $credentials, Options::SIGNATURE => $signature, Options::SERVICE => 'sns', Options::REGION => Region::US_EAST_1));
     $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureInterface', $client->getSignature());
     $this->assertInstanceOf('Aws\\Common\\Credentials\\CredentialsInterface', $client->getCredentials());
     $this->assertInstanceOf('Aws\\Common\\Region\\EndpointProviderInterface', $client->getEndpointProvider());
     $this->assertEquals('https://sns.us-east-1.amazonaws.com', $client->getBaseUrl());
 }
 public function testGenericClientCanAccessDynamoDb()
 {
     /** @var $dynamodb DynamoDbClient */
     $dynamodb = $this->getServiceBuilder()->get('dynamodb', true);
     $credentials = $dynamodb->getCredentials();
     $dynamodb = new \ReflectionClass('Aws\\DynamoDb\\DynamoDbClient');
     $description = (require dirname($dynamodb->getFileName()) . '/Resources/dynamodb-2011-12-05.php');
     /** @var $client DefaultClient */
     $client = DefaultClient::factory(array('credentials' => $credentials, 'signature' => new SignatureV4(), 'service.description' => $description, 'service' => 'dynamodb', 'region' => 'us-east-1'));
     $command = $client->getCommand('ListTables');
     $command->execute();
     $this->assertEquals(200, $command->getResponse()->getStatusCode());
 }