You are here

public function StreamWrapperTest::testSetDefaultConfig in AmazonS3 7.2

Test setting and getting the default configuration.

@covers \Drupal\amazons3\StreamWrapper::setDefaultConfig @covers \Drupal\amazons3\StreamWrapper::getDefaultConfig

File

tests/StreamWrapperTest.php, line 62

Class

StreamWrapperTest
Tests \Drupal\amazons3\StreamWrapper.

Namespace

Drupal\amazons3Test

Code

public function testSetDefaultConfig() {
  $oldConfig = StreamWrapper::getDefaultConfig();
  $config = StreamWrapperConfiguration::fromConfig([
    'bucket' => 'bucket.example.com',
    'region' => 'region',
    'caching' => FALSE,
  ]);
  StreamWrapper::setDefaultConfig($config);
  $this
    ->assertSame($config, StreamWrapper::getDefaultConfig());
  if ($oldConfig) {
    StreamWrapper::setDefaultConfig($oldConfig);
  }
}