diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index c35e026..583b83c 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -388,7 +388,7 @@ public function getAppRoot() { /** * {@inheritdoc} */ - public function boot($rebuild = FALSE) { + public function boot() { if ($this->booted) { return $this; } @@ -423,7 +423,7 @@ public function boot($rebuild = FALSE) { $this->bootstrapContainer = new $class(Settings::get('bootstrap_container_definition', $this->defaultBootstrapContainerDefinition)); // Initialize the container. - $this->initializeContainer($rebuild); + $this->initializeContainer(); // Ensure mt_rand() is reseeded to prevent random values from one page load // being exploited to predict random values in subsequent page loads. diff --git a/core/lib/Drupal/Core/DrupalKernelInterface.php b/core/lib/Drupal/Core/DrupalKernelInterface.php index 739b48c..892952a 100644 --- a/core/lib/Drupal/Core/DrupalKernelInterface.php +++ b/core/lib/Drupal/Core/DrupalKernelInterface.php @@ -21,12 +21,9 @@ /** * Boots the current kernel. * - * @param bool $rebuild - * (optional) Whether to rebuild the container or not. - * * @return $this */ - public function boot($rebuild = FALSE); + public function boot(); /** * Shuts down the kernel. diff --git a/core/lib/Drupal/Core/Test/TestRunnerKernel.php b/core/lib/Drupal/Core/Test/TestRunnerKernel.php index 8c35baa..f19afb3 100644 --- a/core/lib/Drupal/Core/Test/TestRunnerKernel.php +++ b/core/lib/Drupal/Core/Test/TestRunnerKernel.php @@ -50,7 +50,7 @@ public function __construct($environment, $class_loader) { /** * {@inheritdoc} */ - public function boot($rebuild = FALSE) { + public function boot() { // Ensure that required Settings exist. if (!Settings::getAll()) { new Settings(array( @@ -70,7 +70,7 @@ public function boot($rebuild = FALSE) { // In addition, ensure that PHP errors are not hidden away in logs. ini_set('display_errors', TRUE); - parent::boot($rebuild); + parent::boot(); $this->getContainer()->get('module_handler')->loadAll(); diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index d890b41..e19aeae 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -88,6 +88,13 @@ protected $streamWrappers = array(); /** + * The dependency injection container builder used in the test. + * + * @var \Symfony\Component\DependencyInjection\ContainerBuilder + */ + protected $containerBuilder; + + /** * {@inheritdoc} */ function __construct($test_id = NULL) { @@ -287,12 +294,11 @@ protected function tearDown() { * @see \Drupal\simpletest\KernelTestBase::disableModules() */ public function containerBuild(ContainerBuilder $container) { - // Keep the container object around for tests. - $this->container = $container; + // Keep the container builder object around for tests. $this->containerBuilder = $container; // Set the default language on the minimal container. - $this->container->setParameter('language.default_values', $this->defaultLanguageData()); + $container->setParameter('language.default_values', $this->defaultLanguageData()); $container->register('lock', 'Drupal\Core\Lock\NullLockBackend'); $container->register('cache_factory', 'Drupal\Core\Cache\MemoryBackendFactory'); @@ -509,10 +515,6 @@ protected function enableModules(array $modules) { $module_filenames = $module_handler->getModuleList(); $this->kernel->updateModules($module_filenames, $module_filenames); - // Get a fresh container, because ::containerBuild set $this->container to - // the active container builder, but that is no longer the active container. - $this->container = $this->kernel->getContainer(); - // Ensure isLoaded() is TRUE in order to make _theme() work. // Note that the kernel has rebuilt the container; this $module_handler is // no longer the $module_handler instance from above. diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index 3efca1b..4104b4b 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -277,13 +277,6 @@ protected $container; /** - * The dependency injection container builder used in the test. - * - * @var \Symfony\Component\DependencyInjection\ContainerBuilder - */ - protected $containerBuilder; - - /** * The config importer that can used in a test. * * @var \Drupal\Core\Config\ConfigImporter diff --git a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php b/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php index d4f5c23..41afb2d 100644 --- a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php +++ b/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php @@ -30,11 +30,6 @@ function testServiceProviderRegistration() { $definition = $this->containerBuilder->getDefinition('file.usage'); $this->assertTrue($definition->getClass() == 'Drupal\\service_provider_test\\TestFileUsage', 'Class has been changed'); $this->assertTrue(\Drupal::hasService('service_provider_test_class'), 'The service_provider_test_class service has been registered to the DIC'); - // The event subscriber method in the test class calls drupal_set_message with - // a message saying it has fired. This will fire on every page request so it - // should show up on the front page. - //$this->drupalGet(''); - //$this->assertText(t('The service_provider_test event subscriber fired!'), 'The service_provider_test event subscriber fired'); } /**