/** * @covers Drupal\amazons3\S3Url::setPath */ public function testSetPath() { $url = new S3Url('bucket'); $url->setPath(array('directory', 'key')); $this->assertEquals('/directory/key', $url->getPath()); }
/** * Return the image style URL associated with this URL. * * @param string $styleName * The name of the image style. * * @return \Drupal\amazons3\S3Url * An image style URL. */ public function getImageStyleUrl($styleName) { $styleUrl = new S3Url($this->getBucket()); $styleUrl->setPath("/styles/{$styleName}/" . $this->getKey()); return $styleUrl; }