protected function LanguageNegotiationContentEntityTest::createTranslatableEntity in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php \Drupal\Tests\language\Functional\LanguageNegotiationContentEntityTest::createTranslatableEntity()
- 9 core/modules/language/tests/src/Functional/LanguageNegotiationContentEntityTest.php \Drupal\Tests\language\Functional\LanguageNegotiationContentEntityTest::createTranslatableEntity()
Creates a translated entity.
File
- core/
modules/ language/ tests/ src/ Functional/ LanguageNegotiationContentEntityTest.php, line 168
Class
- LanguageNegotiationContentEntityTest
- Tests language negotiation with the language negotiator content entity.
Namespace
Drupal\Tests\language\FunctionalCode
protected function createTranslatableEntity() {
$this->entity = EntityTest::create();
$this->entity
->addTranslation('es', [
'name' => 'name spanish',
]);
$this->entity
->addTranslation('fr', [
'name' => 'name french',
]);
$this->entity
->save();
}