function ContentTranslationOperationsTest::setUp

Same name in other branches
  1. 9 core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationOperationsTest::setUp()
  2. 8.9.x core/modules/content_translation/tests/src/Functional/ContentTranslationOperationsTest.php \Drupal\Tests\content_translation\Functional\ContentTranslationOperationsTest::setUp()
  3. 10 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 53

Class

ContentTranslationOperationsTest
Tests the content translation operations available in the content listing.

Namespace

Drupal\Tests\content_translation\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Enable additional languages.
    $langcodes = [
        'es',
        'ast',
    ];
    foreach ($langcodes as $langcode) {
        static::createLanguageFromLangcode($langcode);
    }
    // Enable translation for the current entity type and ensure the change is
    // picked up.
    \Drupal::service('content_translation.manager')->setEnabled('node', 'article', TRUE);
    $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.