Example #1
0
 /**
  * @depends testHeadBucket
  */
 public function testPutBucketLocation()
 {
     $this->log(__METHOD__);
     $bucketName = self::getResourcePrefix() . '-s3eutest';
     try {
         $this->client->headBucket(array('Bucket' => $bucketName));
     } catch (\Exception $e) {
         $this->client->createBucket(array('Bucket' => $bucketName, 'LocationConstraint' => 'EU'));
     }
     $this->client->waitUntil('bucket_exists', array('Bucket' => $bucketName));
     $result = $this->client->getBucketLocation(array('Bucket' => $bucketName));
     $this->assertEquals('EU', $result['Location']);
     $this->client->deleteBucket(array('Bucket' => $bucketName));
 }
Example #2
0
 /**
  * head
  *
  * @return \Guzzle\Service\Resource\Model
  */
 public function head()
 {
     return $this->client->headBucket(['Bucket' => $this->name]);
 }
Example #3
0
 public function testSignsEmptyRequests()
 {
     $this->client->headBucket(array('Bucket' => $this->bucket));
 }
Example #4
0
 protected function bucketExists(Bucket $bucket, S3Client $client)
 {
     // AWS will throw an Exception if the Bucket doesn't exist or we do not have access to it.
     $response = $client->headBucket(array('Bucket' => $bucket->getName()));
     return true;
 }