You are here

protected function ContentTranslationOperationsTest::setUp in Drupal 10

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

Code

protected function setUp() : void {
  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);
  $this->baseUser1 = $this
    ->drupalCreateUser([
    'access content overview',
  ]);
  $this->baseUser2 = $this
    ->drupalCreateUser([
    'access content overview',
    'create content translations',
    'update content translations',
    'delete content translations',
  ]);
}