public function StreamWrapperTest::testGetInstanceByScheme in Drupal 9
Same name and namespace in other branches
- 8 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 62
Class
- StreamWrapperTest
- Tests stream wrapper functions.
Namespace
Drupal\KernelTests\Core\FileCode
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.');
}