diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php index d698c4e..ba7a3cd 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php @@ -125,10 +125,11 @@ public function testCacheFilename() { $this->assertGreaterThan(TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH, strlen(basename($long_name))); $class = $environment->getTemplateClass($long_name); $key = $cache->generateKey($long_name, $class); - $hash = $this->container->getParameter('twig_extension_hash'); - // The key should consist of the hash, two underscores, and two strings - // truncated to length TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH. - $expected = strlen($hash) + 2 + 2 * TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH; + $prefix = $environment->getTwigCachePrefix(); + // The key should consist of the prefix, an underscore, and two strings + // each truncated to length TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH + // separated by an underscore. + $expected = strlen($prefix) + 2 + 2 * TwigPhpStorageCache::SUFFIX_SUBSTRING_LENGTH; $this->assertEquals($expected, strlen($key)); $original_filename = $environment->getCacheFilename('core/modules/system/templates/container.html.twig');