function StreamWrapperTest::testGetInstanceByScheme

Same name in other branches
  1. 7.x modules/simpletest/tests/file.test \StreamWrapperTest::testGetInstanceByScheme()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php \Drupal\KernelTests\Core\File\StreamWrapperTest::testGetInstanceByScheme()
  3. 10 core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php \Drupal\KernelTests\Core\File\StreamWrapperTest::testGetInstanceByScheme()
  4. 11.x core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php \Drupal\KernelTests\Core\File\StreamWrapperTest::testGetInstanceByScheme()

Tests the getViaScheme() method.

File

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

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->assertEquals($this->classname, get_class($instance), 'Got correct class type for dummy scheme.');
    $instance = \Drupal::service('stream_wrapper_manager')->getViaScheme('public');
    $this->assertEquals('Drupal\\Core\\StreamWrapper\\PublicStream', get_class($instance), 'Got correct class type for public scheme.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.