/** * @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)); }
/** * head * * @return \Guzzle\Service\Resource\Model */ public function head() { return $this->client->headBucket(['Bucket' => $this->name]); }
public function testSignsEmptyRequests() { $this->client->headBucket(array('Bucket' => $this->bucket)); }
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; }