You are here

public function MenuLinkContentTranslationUITest::testTranslationLinkOnMenuEditForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::testTranslationLinkOnMenuEditForm()
  2. 10 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::testTranslationLinkOnMenuEditForm()

Ensure that a translate link can be found on the menu edit form.

File

core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php, line 74

Class

MenuLinkContentTranslationUITest
Tests the menu link content translation UI.

Namespace

Drupal\Tests\menu_link_content\Functional

Code

public function testTranslationLinkOnMenuEditForm() {
  $this
    ->drupalGet('admin/structure/menu/manage/tools');
  $this
    ->assertSession()
    ->linkNotExists('Translate');
  $menu_link_content = MenuLinkContent::create([
    'menu_name' => 'tools',
    'link' => [
      'uri' => 'internal:/admin/structure/menu',
    ],
    'title' => 'Link test',
  ]);
  $menu_link_content
    ->save();
  $this
    ->drupalGet('admin/structure/menu/manage/tools');
  $this
    ->assertSession()
    ->linkExists('Translate');
}