function MenuLinkContentTranslationUITest::testTranslationLinkOnMenuEditForm

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.