You are here

protected function TranslationLinkTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/content_translation/src/Tests/Views/TranslationLinkTest.php \Drupal\content_translation\Tests\Views\TranslationLinkTest::setUp()

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides ContentTranslationTestBase::setUp

File

core/modules/content_translation/src/Tests/Views/TranslationLinkTest.php, line 37
Contains \Drupal\content_translation\Tests\Views\TranslationLinkTest.

Class

TranslationLinkTest
Tests the content translation overview link field handler.

Namespace

Drupal\content_translation\Tests\Views

Code

protected function setUp() {

  // @todo Use entity_type once it is has multilingual Views integration.
  $this->entityTypeId = 'user';
  parent::setUp();

  // Assign user 1  a language code so that the entity can be translated.
  $user = User::load(1);
  $user->langcode = 'en';
  $user
    ->save();

  // Assign user 2 LANGCODE_NOT_SPECIFIED code so entity can't be translated.
  $user = User::load(2);
  $user->langcode = Language::LANGCODE_NOT_SPECIFIED;
  $user
    ->save();
  ViewTestData::createTestViews(get_class($this), array(
    'content_translation_test_views',
  ));
}