diff -u b/core/lib/Drupal/Core/Utility/ThemeRegistry.php b/core/lib/Drupal/Core/Utility/ThemeRegistry.php --- b/core/lib/Drupal/Core/Utility/ThemeRegistry.php +++ b/core/lib/Drupal/Core/Utility/ThemeRegistry.php @@ -35,11 +35,15 @@ /** * The complete theme registry array. + * + * @var array */ protected $completeRegistry; /** * Whether all modules have already been loaded. + * + * @var bool */ protected $modulesLoaded; @@ -58,7 +62,7 @@ * @param \Drupal\Core\Lock\LockBackendInterface $lock * The lock backend. * @param \Drupal\Core\Theme\ActiveTheme $theme - * The theme object representing the active theme for this registry. + * The theme object representing the active theme for this registry. * @param array $tags * (optional) The tags to specify for the cache item. * @param bool $modules_loaded @@ -110,8 +114,8 @@ else { // If there is no runtime cache stored, fetch the full theme registry, // but then initialize each value to NULL. This allows offsetExists() - // to function correctly on non-registered theme hooks without triggering - // a call to resolveCacheMiss(). + // to function correctly on non-registered theme hooks without + // triggering a call to resolveCacheMiss(). $this->storage = $this->initializeRegistry(); foreach (array_keys($this->storage) as $key) { $this->persist($key); @@ -173,7 +177,7 @@ if (!isset($this->completeRegistry)) { $this->completeRegistry = \Drupal::service('theme.registry')->get(); } - $storage = $this->storage; + $storage = $this->getStorage(); $storage[$key] = $this->completeRegistry[$key]; if ($this->getPersistable()) { $this->persist($key); diff -u b/core/modules/system/src/Tests/Theme/RegistryTest.php b/core/modules/system/src/Tests/Theme/RegistryTest.php --- b/core/modules/system/src/Tests/Theme/RegistryTest.php +++ b/core/modules/system/src/Tests/Theme/RegistryTest.php @@ -31,7 +31,6 @@ * Tests the behavior of the theme registry class. */ function testRaceCondition() { - // The theme registry is not marked as persistable in case we don't have a // proper request. \Drupal::request()->setMethod('GET'); @@ -48,7 +47,7 @@ // Trigger a cache miss for an offset. $this->assertTrue($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry.'); - $this->assertTRUE(\Drupal::cache()->get($cid), 'Cache entry was created.'); + $this->assertTrue(\Drupal::cache()->get($cid), 'Cache entry was created.'); // This will cause the ThemeRegistry class to write an updated version of // the cache entry when it is destroyed, usually at the end of the request. // Before that happens, manually delete the cache entry we created earlier