function ContentTranslationOperationsTest::setUp
Same name in other branches
- 9 core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationOperationsTest::setUp()
- 10 core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationOperationsTest::setUp()
- 11.x core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationOperationsTest::setUp()
Overrides NodeTestBase::setUp
File
-
core/
modules/ content_translation/ tests/ src/ Functional/ ContentTranslationOperationsTest.php, line 51
Class
- ContentTranslationOperationsTest
- Tests the content translation operations available in the content listing.
Namespace
Drupal\Tests\content_translation\FunctionalCode
protected function setUp() {
parent::setUp();
// Enable additional languages.
$langcodes = [
'es',
'ast',
];
foreach ($langcodes as $langcode) {
ConfigurableLanguage::createFromLangcode($langcode)->save();
}
// Enable translation for the current entity type and ensure the change is
// picked up.
\Drupal::service('content_translation.manager')->setEnabled('node', 'article', TRUE);
\Drupal::service('router.builder')->rebuild();
$this->baseUser1 = $this->drupalCreateUser([
'access content overview',
]);
$this->baseUser2 = $this->drupalCreateUser([
'access content overview',
'create content translations',
'update content translations',
'delete content translations',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.