You are here

public function StreamWrapperTest::testBasename in AmazonS3 7.2

@covers \Drupal\amazons3\StreamWrapper::getBasename

File

tests/StreamWrapperTest.php, line 346

Class

StreamWrapperTest
Tests \Drupal\amazons3\StreamWrapper.

Namespace

Drupal\amazons3Test

Code

public function testBasename() {
  $config = StreamWrapperConfiguration::fromConfig([
    'bucket' => 'bucket.example.com',
    'region' => 'region',
    'caching' => FALSE,
    'expiration' => 0,
  ]);
  $wrapper = new StreamWrapper($config);
  $wrapper
    ->setUri('s3://bucket.example.com/force-download/test.jpg');
  $this
    ->assertEquals('test.jpg', $wrapper
    ->getBasename());
}