コード例 #1
0
ファイル: S3UrlTest.php プロジェクト: vuhoanglinh2002/drupal
 /**
  * @covers Drupal\amazons3\S3Url::setPath
  */
 public function testSetPath()
 {
     $url = new S3Url('bucket');
     $url->setPath(array('directory', 'key'));
     $this->assertEquals('/directory/key', $url->getPath());
 }
コード例 #2
0
ファイル: S3Url.php プロジェクト: vuhoanglinh2002/drupal
 /**
  * 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;
 }