diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php index 5932c41053..b85c3aad5d 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\content_translation\Functional; -use Drupal\Component\Serialization\Json; use Drupal\field\Entity\FieldConfig; use Drupal\language\Entity\ConfigurableLanguage; use Drupal\field\Entity\FieldStorageConfig; diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php index 4462546040..759bd6dbba 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationWorkflowsTest.php @@ -5,7 +5,7 @@ use Drupal\Component\Utility\SafeMarkup; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Url; -use \Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait; +use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait; use Drupal\user\UserInterface; /** diff --git a/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php b/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php index 2156cde29d..59a8e9bcd3 100644 --- a/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php +++ b/core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php @@ -2,11 +2,8 @@ namespace Drupal\Tests\content_translation\FunctionalJavascript; -use Drupal\Component\Serialization\Json; -use Drupal\field\Entity\FieldConfig; use Drupal\FunctionalJavascriptTests\JavascriptTestBase; use Drupal\language\Entity\ConfigurableLanguage; -use Drupal\field\Entity\FieldStorageConfig; /** * Tests that contextual links are available for content translation. @@ -70,9 +67,8 @@ public function testContentTranslationContextualLinks() { // Check that the translate link appears on the node page. $this->drupalLogin($this->translator); $this->drupalGet('node/' . $node->id()); - $translate_link = '/node/' . $node->id() . '/translations'; - $links = $this->assertSession()->waitForElement('css', '[data-contextual-id^="node:node=1"] .contextual-links a[href^="' . $translate_link . '"]'); - $this->assertNotNull($links); + $link = $this->assertSession()->waitForElement('css', '[data-contextual-id^="node:node=1"] .contextual-links a:contains("Translate")'); + $this->assertContains('node/1/translations', $link->getAttribute('href')); } }