You are here

public function StreamWrapperTest::testConstructDefaultConfig in AmazonS3 7.2

Test that our default configuration is respected.

@covers \Drupal\amazons3\StreamWrapper::__construct

File

tests/StreamWrapperTest.php, line 83

Class

StreamWrapperTest
Tests \Drupal\amazons3\StreamWrapper.

Namespace

Drupal\amazons3Test

Code

public function testConstructDefaultConfig() {
  $config = StreamWrapperConfiguration::fromConfig([
    'bucket' => 'defaultconfig.example.com',
    'region' => 'region',
    'caching' => FALSE,
  ]);
  StreamWrapper::setDefaultConfig($config);
  $wrapper = new StreamWrapper();
  $wrapper
    ->setUri('s3://');
  $this
    ->assertEquals('s3://defaultconfig.example.com', $wrapper
    ->getUri());
}