You are here

protected function EntityReferenceFieldTranslatedReferenceViewTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php \Drupal\field\Tests\EntityReference\EntityReferenceFieldTranslatedReferenceViewTest::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 WebTestBase::setUp

File

core/modules/field/src/Tests/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php, line 123
Contains \Drupal\field\Tests\EntityReference\EntityReferenceFieldTranslatedReferenceViewTest.

Class

EntityReferenceFieldTranslatedReferenceViewTest
Tests the translation of entity reference field display on nodes.

Namespace

Drupal\field\Tests\EntityReference

Code

protected function setUp() {
  parent::setUp();
  $this->labelOfNotTranslatedReference = $this
    ->randomMachineName();
  $this->originalLabel = $this
    ->randomMachineName();
  $this->translatedLabel = $this
    ->randomMachineName();
  $this
    ->setUpLanguages();

  // We setup languages, so we need to ensure that the language manager
  // and language path processor is updated.
  $this
    ->rebuildContainer();
  $this
    ->setUpContentTypes();
  $this
    ->enableTranslation();
  $this
    ->setUpEntityReferenceField();
  $this
    ->createContent();
}