function StreamWrapperManagerTest::testModuleInstallRegistration
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php \Drupal\KernelTests\Core\StreamWrapper\StreamWrapperManagerTest::testModuleInstallRegistration()
Tests installing a module providing a stream wrapper using services.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ StreamWrapper/ StreamWrapperManagerTest.php, line 56
Class
Namespace
Drupal\KernelTests\Core\StreamWrapperCode
public function testModuleInstallRegistration() : void {
$this->container
->get('stream_wrapper_manager')
->register();
$this->container
->get('module_installer')
->install([
'stream_wrapper_service_test',
]);
$manager = \Drupal::service('stream_wrapper_manager');
$this->assertSame(ServiceDependencyStreamWrapper::class, $manager->getClass('test'));
$wrapper = $manager->getViaScheme('test');
$this->assertInstanceOf(ServiceDependencyStreamWrapper::class, $wrapper);
$this->assertSame($manager, $wrapper->streamWrapperManager);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.