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,6 +31,7 @@ * 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'); @@ -39,9 +40,10 @@ // entry to be written in __construct(). $cache = \Drupal::cache(); $lock_backend = \Drupal::lock(); - $cid = 'theme_registry:runtime:core'; - $registry = new ThemeRegistry($cache, $lock_backend, array('theme_registry'), $this->container->get('module_handler')->isLoaded()); + $theme = \Drupal::theme(); + $registry = new ThemeRegistry($cache, $lock_backend, $theme->getActiveTheme(), array('theme_registry'), $this->container->get('module_handler')->isLoaded()); + $cid = 'theme_registry:runtime:' . $theme->getActiveTheme()->getName(); $this->assertFalse(\Drupal::cache()->get($cid), 'Cache entry was not created by default.'); // Trigger a cache miss for an offset. @@ -61,7 +63,7 @@ // Create a new instance of the class. Confirm that both the offset // requested previously, and one that has not yet been requested are both // available. - $registry = new ThemeRegistry($cache, $lock_backend, array('theme_registry'), $this->container->get('module_handler')->isLoaded()); + $registry = new ThemeRegistry($cache, $lock_backend, $theme->getActiveTheme(), array('theme_registry'), $this->container->get('module_handler')->isLoaded()); $this->assertTrue($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry'); $this->assertTrue($registry->get('theme_test_template_test_2'), 'Offset was returned correctly from the theme registry'); }