protected function ContentTranslationContextualLinksTest::setUp in Drupal 10
Same name in this branch
- 10 core/modules/content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationContextualLinksTest::setUp()
- 10 core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php \Drupal\Tests\content_translation\FunctionalJavascript\ContentTranslationContextualLinksTest::setUp()
Same name and namespace in other branches
- 8 core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php \Drupal\Tests\content_translation\FunctionalJavascript\ContentTranslationContextualLinksTest::setUp()
- 9 core/modules/content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php \Drupal\Tests\content_translation\FunctionalJavascript\ContentTranslationContextualLinksTest::setUp()
File
- core/
modules/ content_translation/ tests/ src/ FunctionalJavascript/ ContentTranslationContextualLinksTest.php, line 35
Class
- ContentTranslationContextualLinksTest
- Tests that contextual links are available for content translation.
Namespace
Drupal\Tests\content_translation\FunctionalJavascriptCode
protected function setUp() : void {
parent::setUp();
// Set up an additional language.
ConfigurableLanguage::createFromLangcode('es')
->save();
// Create a content type.
$this
->drupalCreateContentType([
'type' => 'page',
]);
// Enable content translation.
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('admin/config/regional/content-language');
$edit = [
'entity_types[node]' => TRUE,
'settings[node][page][translatable]' => TRUE,
];
$this
->submitForm($edit, 'Save configuration');
$this
->drupalLogout();
// Create a translator user.
$permissions = [
'access contextual links',
'administer nodes',
'edit any page content',
'translate any entity',
];
$this->translator = $this
->drupalCreateUser($permissions);
}