diff --git a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php index 2e62ea2..fc6b6be 100644 --- a/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php +++ b/core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php @@ -67,6 +67,10 @@ class StreamWrapperManager extends ContainerAware { /** * Constructs a StreamWrapperManager object. * + * The parameters are optional so that they can be left out in special + * scenarios like the installer and kernel tests, where the added complexity + * is not required. + * * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher * (optional) The event dispatcher to dispatch the stream wrapper alter * event. @@ -294,7 +298,8 @@ public function addStreamWrapper($service_id, $class, $scheme) { public function register() { // Only expose the private file stream wrapper if a file path has been set. // @todo Convert this to settings to avoid loading this from the - // configuration system early in the request. + // configuration system early in the request in + // https://drupal.org/node/2170235 if (!$this->configFactory || !$this->configFactory->get('system.file')->get('path.private')) { unset($this->info['private']); } diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index c055553..bf023b1 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -314,7 +314,8 @@ public function containerBuild(ContainerBuilder $container) { // Register the stream wrapper manager. $container ->register('stream_wrapper_manager', 'Drupal\Core\StreamWrapper\StreamWrapperManager') - ->setArguments([new Reference('service_container'), new Reference('config.factory')]); + ->setArguments([NULL, new Reference('config.factory')]) + ->addMethodCall('setContainer', array(new Reference('service_container'))); $request = Request::create('/'); $container->get('request_stack')->push($request);