You are here

protected function LanguageNegotiationContentEntityTest::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/language/src/Tests/LanguageNegotiationContentEntityTest.php \Drupal\language\Tests\LanguageNegotiationContentEntityTest::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/language/src/Tests/LanguageNegotiationContentEntityTest.php, line 45
Contains \Drupal\language\Tests\LanguageNegotiationLanguageContentEntityTest.

Class

LanguageNegotiationContentEntityTest
Tests language negotiation with the language negotiator content entity.

Namespace

Drupal\language\Tests

Code

protected function setUp() {
  parent::setUp();
  ConfigurableLanguage::create([
    'id' => 'es',
  ])
    ->save();
  ConfigurableLanguage::create([
    'id' => 'fr',
  ])
    ->save();

  // In order to reflect the changes for a multilingual site in the container
  // we have to rebuild it.
  $this
    ->rebuildContainer();
  $this
    ->createTranslatableEntity();
  $user = $this
    ->drupalCreateUser(array(
    'view test entity',
  ));
  $this
    ->drupalLogin($user);
}