diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php index 5e19805..d25efb2 100644 --- a/core/lib/Drupal/Core/Theme/Registry.php +++ b/core/lib/Drupal/Core/Theme/Registry.php @@ -439,7 +439,7 @@ protected function processExtension(array &$cache, $name, $type, $theme, $path) 'base hook' => TRUE, ); - $module_list = array_keys((array) $this->moduleHandler->getModuleList()); + $module_list = array_keys($this->moduleHandler->getModuleList()); // Invoke the hook_theme() implementation, preprocess what is returned, and // merge it into $cache. diff --git a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php index 4a9101d..0cb5a25 100644 --- a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php +++ b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php @@ -105,6 +105,9 @@ public function testGetRegistryForModule() { ->method('getImplementations') ->with('theme') ->will($this->returnValue(array('theme_test'))); + $this->moduleHandler->expects($this->atLeastOnce()) + ->method('getModuleList') + ->willReturn([]); $registry = $this->registry->get();