protected function ModerationLocaleTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php \Drupal\Tests\content_moderation\Functional\ModerationLocaleTest::setUp()
- 10 core/modules/content_moderation/tests/src/Functional/ModerationLocaleTest.php \Drupal\Tests\content_moderation\Functional\ModerationLocaleTest::setUp()
Sets the test up.
Overrides ModerationStateTestBase::setUp
File
- core/
modules/ content_moderation/ tests/ src/ Functional/ ModerationLocaleTest.php, line 34
Class
- ModerationLocaleTest
- Test content_moderation functionality with localization and translation.
Namespace
Drupal\Tests\content_moderation\FunctionalCode
protected function setUp() {
parent::setUp();
$this
->drupalLogin($this->rootUser);
// Enable moderation on Article node type.
$this
->createContentTypeFromUi('Article', 'article', TRUE);
// Add French and Italian languages.
foreach ([
'fr',
'it',
] as $langcode) {
$edit = [
'predefined_langcode' => $langcode,
];
$this
->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
}
// Enable content translation on articles.
$this
->drupalGet('admin/config/regional/content-language');
$edit = [
'entity_types[node]' => TRUE,
'settings[node][article][translatable]' => TRUE,
'settings[node][article][settings][language][language_alterable]' => TRUE,
];
$this
->drupalPostForm(NULL, $edit, t('Save configuration'));
// Adding languages requires a container rebuild in the test running
// environment so that multilingual services are used.
$this
->rebuildContainer();
}