You are here

public function StreamWrapperTest::testGetInstanceByScheme in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php \Drupal\KernelTests\Core\File\StreamWrapperTest::testGetInstanceByScheme()

Test the getViaScheme() method.

File

core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php, line 61

Class

StreamWrapperTest
Tests stream wrapper functions.

Namespace

Drupal\KernelTests\Core\File

Code

public function testGetInstanceByScheme() {
  $instance = \Drupal::service('stream_wrapper_manager')
    ->getViaScheme($this->scheme);
  $this
    ->assertEqual($this->classname, get_class($instance), 'Got correct class type for dummy scheme.');
  $instance = \Drupal::service('stream_wrapper_manager')
    ->getViaScheme('public');
  $this
    ->assertEqual('Drupal\\Core\\StreamWrapper\\PublicStream', get_class($instance), 'Got correct class type for public scheme.');
}