You are here

public function StreamWrapperTest::testExternalImageStyleUri in AmazonS3 7.2

Test when an image doesn't exist that we return the internal style URL.

@covers \Drupal\amazons3\StreamWrapper::getExternalUrl

File

tests/StreamWrapperTest.php, line 199

Class

StreamWrapperTest
Tests \Drupal\amazons3\StreamWrapper.

Namespace

Drupal\amazons3Test

Code

public function testExternalImageStyleUri() {
  $wrapper = new StreamWrapper();
  $wrapper
    ->setUri('s3://bucket.example.com/styles/thumbnail/image.jpg');
  $this
    ->assertEquals('http://amazons3.example.com/' . StreamWrapper::stylesCallback . '/bucket.example.com/styles/thumbnail/image.jpg', $wrapper
    ->getExternalUrl());
}