You are here

protected function LingotekSettingsTabContentFormWithLotsOfContentTest::setUp in Lingotek Translation 3.6.x

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  2. 4.0.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  3. 3.0.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  4. 3.1.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  5. 3.2.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  6. 3.3.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  7. 3.4.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  8. 3.5.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  9. 3.7.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()
  10. 3.8.x tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php \Drupal\Tests\lingotek\FunctionalJavascript\LingotekSettingsTabContentFormWithLotsOfContentTest::setUp()

Overrides LingotekFunctionalJavascriptTestBase::setUp

File

tests/src/FunctionalJavascript/LingotekSettingsTabContentFormWithLotsOfContentTest.php, line 15

Class

LingotekSettingsTabContentFormWithLotsOfContentTest
@group lingotek

Namespace

Drupal\Tests\lingotek\FunctionalJavascript

Code

protected function setUp() : void {
  parent::setUp();

  // Place the actions and title block.
  $this
    ->drupalPlaceBlock('page_title_block', [
    'region' => 'content',
    'weight' => -5,
  ]);
  $this
    ->drupalPlaceBlock('local_actions_block', [
    'region' => 'content',
    'weight' => -10,
  ]);

  // Add a language.
  ConfigurableLanguage::createFromLangcode('es')
    ->setThirdPartySetting('lingotek', 'locale', 'es_MX')
    ->save();

  // Create Article node types.
  $this
    ->drupalCreateContentType([
    'type' => 'article',
    'name' => 'Article',
  ]);
  foreach (range(1, 150) as $i) {
    $this
      ->drupalCreateContentType([
      'type' => 'content_type_' . $i,
      'name' => 'Content Type ' . $i,
    ]);
  }
  $this
    ->createImageField('field_image', 'article');
  $this
    ->createImageField('user_picture', 'user', 'user');

  // Enable translation for the current entity type and ensure the change is
  // picked up.
  ContentLanguageSettings::loadByEntityTypeBundle('node', 'article')
    ->setLanguageAlterable(TRUE)
    ->save();
  \Drupal::service('content_translation.manager')
    ->setEnabled('node', 'article', TRUE);
  foreach (range(1, 150) as $i) {
    ContentLanguageSettings::loadByEntityTypeBundle('node', 'content_type_' . $i)
      ->setLanguageAlterable(TRUE)
      ->save();
    \Drupal::service('content_translation.manager')
      ->setEnabled('node', 'content_type_' . $i, TRUE);
  }
  ContentLanguageSettings::loadByEntityTypeBundle('user', 'user')
    ->setLanguageAlterable(TRUE)
    ->save();
  \Drupal::service('content_translation.manager')
    ->setEnabled('user', 'user', TRUE);
}