diff --git a/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php b/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php index e0e17b8..3f2852d 100644 --- a/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php +++ b/core/modules/locale/src/Tests/LocaleJavascriptTranslationTest.php @@ -148,14 +148,8 @@ public function testLocaleTranslationJsDependencies() { $js_translation_files = \Drupal::state()->get('locale.translation.javascript'); $js_filename = $prefix . '_' . $js_translation_files[$prefix] . '.js'; - // Get the src of the script previous to drupal.js which contains the - // translations. - $xpath = '//script[contains(@src, "drupal.js")]/preceding-sibling::script[contains(@src, "' . $js_filename . '")]/@src'; - $elements = $this->xpath($xpath); - $filename = explode('?', basename(((string)($elements[0]['src']))))[0]; - - // If the script was there, translations are included successfully. - $this->assertEqual($filename, $js_filename); + // Assert translations js is included before drupal.js. + $this->assertTrue(strpos($this->content, $js_filename) < strpos($this->content, 'core/misc/drupal.js'), 'Translations are included before Drupal.t.'); } }