You are here

public function StreamWrapperTest::testExternalUri in AmazonS3 7.2

Test regular URL generation.

@covers \Drupal\amazons3\StreamWrapper::getExternalUrl @covers \Drupal\amazons3\StreamWrapper::getLocalPath @covers \Drupal\amazons3\StreamWrapper::forceDownload @covers \Drupal\amazons3\StreamWrapper::getS3Url

File

tests/StreamWrapperTest.php, line 213

Class

StreamWrapperTest
Tests \Drupal\amazons3\StreamWrapper.

Namespace

Drupal\amazons3Test

Code

public function testExternalUri() {
  $wrapper = new StreamWrapper();
  $wrapper
    ->setUri('s3://bucket.example.com/image.jpg');
  $this
    ->assertEquals('https://s3.amazonaws.com/bucket.example.com/image.jpg', $wrapper
    ->getExternalUrl());
}