You are here

public function S3ClientTest::testGetBucketLocation in AmazonS3 7.2

@covers \Drupal\amazons3\S3Client::getBucketLocation

File

tests/S3ClientTest.php, line 88

Class

S3ClientTest
Tests \Drupal\amazons3\S3Client.

Namespace

Drupal\amazons3

Code

public function testGetBucketLocation() {
  $client = $this
    ->mockClient();
  $responseBody = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/">fake-region</LocationConstraint>
EOD;
  $this
    ->setMockResponse($client, array(
    new Response(200, array(), $responseBody),
  ));
  $this
    ->assertEquals('fake-region', \Drupal\amazons3\S3Client::getBucketLocation('example-bucket', $client));
}