You are here

protected function EntityUrlLanguageTest::setUp in Zircon Profile 8

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

Performs setup tasks before each individual test method is run.

Overrides LanguageTestBase::setUp

File

core/modules/language/src/Tests/EntityUrlLanguageTest.php, line 39
Contains \Drupal\language\Tests\EntityUrlLanguageTest.

Class

EntityUrlLanguageTest
Tests the language of entity URLs. @group language

Namespace

Drupal\language\Tests

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('entity_test');
  $this
    ->installEntitySchema('configurable_language');
  $this
    ->installSchema('system', 'router');
  \Drupal::service('router.builder')
    ->rebuild();

  // In order to reflect the changes for a multilingual site in the container
  // we have to rebuild it.
  ConfigurableLanguage::create([
    'id' => 'es',
  ])
    ->save();
  ConfigurableLanguage::create([
    'id' => 'fr',
  ])
    ->save();
  $config = $this
    ->config('language.negotiation');
  $config
    ->set('url.prefixes', [
    'en' => 'en',
    'es' => 'es',
    'fr' => 'fr',
  ])
    ->save();
  $this->kernel
    ->rebuildContainer();
  $this
    ->createTranslatableEntity();
}