diff --git a/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php index 827fd10..a093ae8 100644 --- a/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php +++ b/core/modules/shortcut/src/Tests/ShortcutTranslationUITest.php @@ -64,8 +64,9 @@ protected function doTestBasicTranslation() { $path = \Drupal::urlGenerator()->generateFromRoute('', array(), array('language' => $language)); $this->drupalGet($path); $expected_path = \Drupal::urlGenerator()->generateFromRoute('system.admin', array(), array('language' => $language)); - $elements = $this->xpath('//nav[contains(@class, "toolbar-lining")]/ul[@class="menu"]/li/a[@href=:href]', array(':href' => $expected_path)); - $this->assertEqual((string) $elements[0], $entity->getTranslation($langcode)->label()); + $label = $entity->getTranslation($langcode)->label(); + $elements = $this->xpath('//nav[contains(@class, "toolbar-lining")]/ul[@class="menu"]/li/a[@href=:href and normalize-space(text())=:label]', array(':href' => $expected_path, ':label' => $label)); + $this->assertTrue(!empty($elements), format_string('Translated @language shortcut link @label found.', array('@label' => $label, '@language' => $language->getName()))); } } }