function EntityUrlLanguageTest::testEntityUrlLanguage
Same name in other branches
- 8.9.x core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php \Drupal\Tests\language\Kernel\EntityUrlLanguageTest::testEntityUrlLanguage()
- 10 core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php \Drupal\Tests\language\Kernel\EntityUrlLanguageTest::testEntityUrlLanguage()
- 11.x core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php \Drupal\Tests\language\Kernel\EntityUrlLanguageTest::testEntityUrlLanguage()
Ensures that entity URLs in a language have the right language prefix.
1 call to EntityUrlLanguageTest::testEntityUrlLanguage()
- EntityUrlLanguageTest::testEntityUrlLanguageWithLanguageContentEnabled in core/
modules/ language/ tests/ src/ Kernel/ EntityUrlLanguageTest.php - Ensures correct entity URLs with the method language-content-entity enabled.
File
-
core/
modules/ language/ tests/ src/ Kernel/ EntityUrlLanguageTest.php, line 60
Class
- EntityUrlLanguageTest
- Tests the language of entity URLs. @group language
Namespace
Drupal\Tests\language\KernelCode
public function testEntityUrlLanguage() {
$this->assertStringContainsString('/en/entity_test/' . $this->entity
->id(), $this->entity
->toUrl()
->toString());
$this->assertStringContainsString('/es/entity_test/' . $this->entity
->id(), $this->entity
->getTranslation('es')
->toUrl()
->toString());
$this->assertStringContainsString('/fr/entity_test/' . $this->entity
->id(), $this->entity
->getTranslation('fr')
->toUrl()
->toString());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.