public function testAddsUserAgentIfAvailable()
 {
     $response = new Response(200);
     $response->setRequest(new Request('GET', 'http://www.foo.com', array('User-Agent' => 'Foo/Bar')));
     $e = new ServiceResponseException('Foo!');
     $e->setExceptionCode('foo');
     $e->setExceptionType('client');
     $e->setRequestId('xyz');
     $e->setResponse($response);
     $this->assertEquals('Aws\\Common\\Exception\\ServiceResponseException: AWS Error Code: foo, Status Code: 200, AWS Request ID: xyz, AWS Error Type: client, AWS Error Message: Foo!, User-Agent: Foo/Bar', (string) $e);
 }
 public function testRepresentsException()
 {
     $e = new ServiceResponseException('Foo!');
     $e->setExceptionCode('foo');
     $this->assertEquals('foo', $e->getExceptionCode());
     $e->setExceptionType('client');
     $this->assertEquals('client', $e->getExceptionType());
     $e->setRequestId('xyz');
     $this->assertEquals('xyz', $e->getRequestId());
     $response = new Response(200);
     $e->setResponse($response);
     $this->assertSame($response, $e->getResponse());
     $this->assertEquals('Aws\\Common\\Exception\\ServiceResponseException: AWS Error Code: foo, Status Code: 200, AWS Request ID: xyz, AWS Error Type: client, AWS Error Message: Foo!', (string) $e);
 }