diff --git a/core/lib/Drupal/Core/Render/ElementInfoManager.php b/core/lib/Drupal/Core/Render/ElementInfoManager.php index a006056..1bc1600 100644 --- a/core/lib/Drupal/Core/Render/ElementInfoManager.php +++ b/core/lib/Drupal/Core/Render/ElementInfoManager.php @@ -80,12 +80,8 @@ public function getInfo($type) { if (!isset($this->elementInfo[$theme_name])) { $this->elementInfo[$theme_name] = $this->buildInfo($theme_name); } - $info = []; - if (isset($this->elementInfo[$theme_name][$type])) { - $info = $this->elementInfo[$theme_name][$type]; - $info['#defaults_loaded'] = TRUE; - } - + $info = isset($this->elementInfo[$theme_name][$type]) ? $this->elementInfo[$theme_name][$type] : array(); + $info['#defaults_loaded'] = TRUE; return $info; } diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php index 5abf972..2f7deec 100644 --- a/core/modules/simpletest/src/KernelTestBase.php +++ b/core/modules/simpletest/src/KernelTestBase.php @@ -33,6 +33,9 @@ * Additional modules needed in a test may be loaded and added to the fixed * module list. * + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.2.x. Use + * \Drupal\Tests\KernelTestBase instead. + * * @see \Drupal\simpletest\KernelTestBase::$modules * @see \Drupal\simpletest\KernelTestBase::enableModules() * diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php index 6f80459..f7058a0 100644 --- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php +++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php @@ -25,7 +25,7 @@ protected function setUp() { parent::setUp(); // @todo ModuleInstaller calls system_rebuild_module_data which is part of - // system.module, see https://www.drupal.org/node/2208429 + // system.module, see https://www.drupal.org/node/2208429. include_once $this->root . '/core/modules/system/system.module'; // Set up the state values so we know where to find the files when running diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php index 6a5c7e7..252946f 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php +++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php @@ -171,7 +171,7 @@ public function testCompiledContainerIsDestructed() { public function testRender() { $type = 'processed_text'; $element_info = $this->container->get('element_info'); - $this->assertEmpty($element_info->getInfo($type)); + $this->assertSame(['#defaults_loaded' => TRUE], $element_info->getInfo($type)); $this->enableModules(array('filter')); diff --git a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php index 1277c64..b0ca1f7 100644 --- a/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Render/ElementInfoManagerTest.php @@ -136,6 +136,7 @@ public function providerTestGetInfo() { $data[] = array( 'form', array( + '#defaults_loaded' => TRUE, ), array('page' => array( '#theme' => 'page', diff --git a/core/tests/Drupal/Tests/KernelTestBase.php b/core/tests/Drupal/Tests/KernelTestBase.php index eaafda4..0b17312 100644 --- a/core/tests/Drupal/Tests/KernelTestBase.php +++ b/core/tests/Drupal/Tests/KernelTestBase.php @@ -597,7 +597,8 @@ public function register(ContainerBuilder $container) { /** * BC alias for register(). * - * @deprecated 8.0.x:8.0.0 + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0. + * * @see \Drupal\Tests\KernelTestBase::register() */ public function containerBuild(ContainerBuilder $container) { @@ -915,7 +916,8 @@ protected function setSetting($name, $value) { /** * BC alias for setSetting(). * - * @deprecated 8.0.x:8.0.0 + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0. + * * @see \Drupal\Tests\KernelTestBase::setSetting() */ protected function settingsSet($name, $value) { @@ -1099,7 +1101,7 @@ protected function isTestInIsolation() { * Test authors should follow the provided instructions and adjust their tests * accordingly. * - * @deprecated 8.0.x:8.0.0 + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0. */ public function __get($name) { if (in_array($name, array( @@ -1167,7 +1169,7 @@ public function __get($name) { * Test authors should follow the provided instructions and adjust their tests * accordingly. * - * @deprecated 8.0.x:8.0.0 + * @deprecated in Drupal 8.0.x, will be removed before Drupal 8.0.0. */ public function __set($name, $value) { $this->__get($name); diff --git a/core/tests/bootstrap.php b/core/tests/bootstrap.php index 6a16ea4..81679ee 100644 --- a/core/tests/bootstrap.php +++ b/core/tests/bootstrap.php @@ -61,6 +61,9 @@ function drupal_phpunit_contrib_extension_directory_roots() { * * @param array $dirs * An associative array of extension directories, keyed by extension name. + * + * @return array + * An associative array of extension directories, keyed by their namespace. */ function drupal_phpunit_get_extension_namespaces($dirs) { $namespaces = array();