public function testErrorsAreParsedCorrectly() { try { $this->client->deleteDataset(array('IdentityPoolId' => 'abc:123af', 'IdentityId' => 'foo:123af', 'DatasetName' => 'bar')); $this->fail('An exception should have been thrown.'); } catch (ServiceResponseException $e) { $this->assertEquals('ResourceNotFoundException', $e->getExceptionCode(), 'Caught a ' . $e->getExceptionCode() . ' exception instead.'); } }
/** * @covers Aws\CognitoSync\CognitoSyncClient::factory */ public function testFactoryInitializesClient() { $client = CognitoSyncClient::factory(array('key' => 'foo', 'secret' => 'bar', 'region' => 'us-east-1')); $this->assertInstanceOf('Aws\\Common\\Signature\\SignatureV4', $client->getSignature()); $this->assertInstanceOf('Aws\\Common\\Credentials\\Credentials', $client->getCredentials()); $this->assertEquals('https://cognito-sync.us-east-1.amazonaws.com', $client->getBaseUrl()); }