function EntityUrlLanguageTest::setUp
Same name in other branches
- 8.9.x 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 37
Class
- EntityUrlLanguageTest
- Tests the language of entity URLs. @group language
Namespace
Drupal\Tests\language\KernelCode
protected function setUp() : void {
parent::setUp();
$this->installEntitySchema('entity_test');
$this->installEntitySchema('configurable_language');
// 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.