public function StreamWrapperTest::testNoCustomDomain in AmazonS3 7.2
@covers \Drupal\amazons3\StreamWrapper::getExternalUrl @covers \Drupal\amazons3\StreamWrapper::injectCname
File
- tests/
StreamWrapperTest.php, line 517
Class
Namespace
Drupal\amazons3TestCode
public function testNoCustomDomain() {
$config = StreamWrapperConfiguration::fromConfig([
'bucket' => 'bucket.example.com',
'region' => 'region',
'caching' => FALSE,
]);
$wrapper = new StreamWrapper($config);
$wrapper
->setUri('s3://bucket.example.com/image.jpg');
$url = Url::factory($wrapper
->getExternalUrl());
$this
->assertEquals('s3.amazonaws.com', $url
->getHost());
}