function MenuUiContentTranslationTest::setUp

Same name and namespace in other branches
  1. 10 core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php \Drupal\Tests\menu_ui\Functional\MenuUiContentTranslationTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/menu_ui/tests/src/Functional/MenuUiContentTranslationTest.php, line 41

Class

MenuUiContentTranslationTest
Tests Menu UI and Content Translation integration for content entities.

Namespace

Drupal\Tests\menu_ui\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Place menu block and local tasks block.
    $this->drupalPlaceBlock('system_menu_block:main');
    $this->drupalPlaceBlock('local_tasks_block');
    // Create a 'page' content type.
    $this->drupalCreateContentType([
        'type' => 'page',
        'name' => 'Basic page',
        'display_submitted' => FALSE,
    ]);
    // Add a second language.
    static::createLanguageFromLangcode('de');
    // Create an account and login.
    $user = $this->drupalCreateUser([
        'administer site configuration',
        'administer nodes',
        'create page content',
        'edit any page content',
        'delete any page content',
        'administer content translation',
        'translate any entity',
        'create content translations',
        'administer languages',
        'administer content types',
        'administer menu',
    ]);
    $this->drupalLogin($user);
    // Enable translation for page nodes and menu link content.
    static::enableBundleTranslation('node', 'page');
    static::enableBundleTranslation('menu_link_content', 'menu_link_content');
}

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