function ContentTranslationLanguageChangeTest::setUp
Overrides NodeTestBase::setUp
File
-
core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationLanguageChangeTest.php, line 49
Class
- ContentTranslationLanguageChangeTest
- Tests the content translation language that is set.
Namespace
Drupal\Tests\content_translation\FunctionalCode
protected function setUp() : void {
parent::setUp();
$langcodes = [
'de',
'fr',
];
foreach ($langcodes as $langcode) {
static::createLanguageFromLangcode($langcode);
}
$this->drupalPlaceBlock('local_tasks_block');
// Enable translations for article.
$this->enableContentTranslation('node', 'article');
$this->rebuildContainer();
$this->createImageField('field_image_field', 'node', 'article');
$user = $this->drupalCreateUser([
'administer site configuration',
'administer nodes',
'create article content',
'edit any article content',
'delete any article content',
'administer content translation',
'translate article node',
'create content translations',
'administer languages',
'administer content types',
'administer node fields',
]);
$this->drupalLogin($user);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.