diff --git a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php index 5296bc54eb..08aacecd41 100644 --- a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php +++ b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php @@ -2,6 +2,7 @@ namespace Drupal\Tests\language\Functional; +use Drupal\Core\Cache\Cache; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\language\Entity\ContentLanguageSettings; use Drupal\node\Entity\Node; @@ -77,8 +78,6 @@ protected function setUp() { // Load the Spanish Node page once, to register the translatable string. $this->drupalGet('/es/node/1'); - drupal_flush_all_caches(); - // Translate the Powered by string. /** @var \Drupal\locale\StringStorageInterface $string_storage */ $string_storage = \Drupal::getContainer()->get('locale.storage'); @@ -90,6 +89,8 @@ protected function setUp() { 'language' => 'es', 'translation' => 'Funciona con ...', ])->save(); + // Invalidate caches so that the new translation will be used. + Cache::invalidateTags(['rendered', 'locale']); } /**