You are here

public function SchemeExtensionTraitTest::test in Flysystem 3.0.x

Same name and namespace in other branches
  1. 8 tests/src/Unit/Asset/SchemeExtensionTraitTest.php \Drupal\Tests\flysystem\Unit\Asset\SchemeExtensionTraitTest::test()
  2. 3.x tests/src/Unit/Asset/SchemeExtensionTraitTest.php \Drupal\Tests\flysystem\Unit\Asset\SchemeExtensionTraitTest::test()
  3. 2.0.x tests/src/Unit/Asset/SchemeExtensionTraitTest.php \Drupal\Tests\flysystem\Unit\Asset\SchemeExtensionTraitTest::test()

@covers ::getSchemeForExtension

File

tests/src/Unit/Asset/SchemeExtensionTraitTest.php, line 18

Class

SchemeExtensionTraitTest
@coversDefaultClass \Drupal\flysystem\Asset\SchemeExtensionTrait @group flysystem

Namespace

Drupal\Tests\flysystem\Unit\Asset

Code

public function test() {
  new Settings([
    'flysystem' => [
      'local' => [
        'serve_js' => TRUE,
        'driver' => 'asdf',
      ],
      'ftp' => [
        'serve_css' => TRUE,
      ],
    ],
  ]);
  $trait = $this
    ->getMockForTrait(SchemeExtensionTrait::class);
  $this
    ->assertSame('local', $trait
    ->getSchemeForExtension('js'));
  $this
    ->assertSame('public', $trait
    ->getSchemeForExtension('css'));
  $this
    ->assertSame('public', $trait
    ->getSchemeForExtension('jpg'));
}