function EntityUrlLanguageTest::setUp
Same name in other branches
- 9 core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php \Drupal\Tests\language\Kernel\EntityUrlLanguageTest::setUp()
- 10 core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php \Drupal\Tests\language\Kernel\EntityUrlLanguageTest::setUp()
- 11.x core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php \Drupal\Tests\language\Kernel\EntityUrlLanguageTest::setUp()
Overrides LanguageTestBase::setUp
File
-
core/
modules/ language/ tests/ src/ Kernel/ EntityUrlLanguageTest.php, line 34
Class
- EntityUrlLanguageTest
- Tests the language of entity URLs. @group language
Namespace
Drupal\Tests\language\KernelCode
protected function setUp() {
parent::setUp();
$this->installEntitySchema('entity_test');
$this->installEntitySchema('configurable_language');
\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();
\Drupal::service('kernel')->rebuildContainer();
$this->createTranslatableEntity();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.