/** * @covers Drupal\amazons3\S3Url::setBucket * @covers Drupal\amazons3\S3Url::getBucket */ public function testGetBucket() { $url = new S3Url('bucket'); $url->setBucket('second-bucket'); $this->assertEquals('second-bucket', $url->getBucket()); }
/** * Get a regular S3 URL for a key. * * @param string $key * The S3 object key. * @param int $expiry * (optional) Expiry time for the URL, as a Unix timestamp. * @param array $args * (optional) Array of additional arguments to pass to getObjectUrl(). * * @return \Guzzle\Http\Url * An https URL to access the key. */ protected function getS3Url($key, $expiry = NULL, array $args = array()) { $url = Url::factory(static::$client->getObjectUrl($this->uri->getBucket(), $key, $expiry, $args)); $this->injectCname($url); return $url; }