function MenuLinkContentTranslationUITest::testTranslationLinkTheme

Same name and namespace in other branches
  1. 9 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::testTranslationLinkTheme()
  2. 10 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::testTranslationLinkTheme()
  3. 11.x core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentTranslationUITest::testTranslationLinkTheme()

Tests that translation page inherits admin status of edit page.

File

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

Class

MenuLinkContentTranslationUITest
Tests the menu link content translation UI.

Namespace

Drupal\Tests\menu_link_content\Functional

Code

public function testTranslationLinkTheme() {
  $this->drupalLogin($this->administrator);
  $entityId = $this->createEntity([], 'en');
  // Set up Seven as the admin theme to test.
  $this->container
    ->get('theme_installer')
    ->install([
    'seven',
  ]);
  $edit = [];
  $edit['admin_theme'] = 'seven';
  $this->drupalPostForm('admin/appearance', $edit, t('Save configuration'));
  $this->drupalGet('admin/structure/menu/item/' . $entityId . '/edit');
  $this->assertRaw('core/themes/seven/css/base/elements.css', 'Edit uses admin theme.');
  $this->drupalGet('admin/structure/menu/item/' . $entityId . '/edit/translations');
  $this->assertRaw('core/themes/seven/css/base/elements.css', 'Translation uses admin theme as well.');
}

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