You are here

public function StreamWrapperTest::testCreateClient in AmazonS3 7.2

Test that when needed the StreamWrapper will create a client.

@covers \Drupal\amazons3\StreamWrapper::__construct

File

tests/StreamWrapperTest.php, line 100

Class

StreamWrapperTest
Tests \Drupal\amazons3\StreamWrapper.

Namespace

Drupal\amazons3Test

Code

public function testCreateClient() {
  StreamWrapper::setClient(null);
  $config = StreamWrapperConfiguration::fromConfig([
    'bucket' => 'bucket.example.com',
    'region' => 'region',
    'caching' => FALSE,
    'region' => 'us-east-1',
  ]);
  $wrapper = new StreamWrapper($config);
  $this
    ->assertNotNull($wrapper
    ->getClient());
}