You are here

protected function LanguageNegotiationContentEntityTest::createTranslatableEntity in Zircon Profile 8

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

Creates a translated entity.

1 call to LanguageNegotiationContentEntityTest::createTranslatableEntity()
LanguageNegotiationContentEntityTest::setUp in core/modules/language/src/Tests/LanguageNegotiationContentEntityTest.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/language/src/Tests/LanguageNegotiationContentEntityTest.php, line 159
Contains \Drupal\language\Tests\LanguageNegotiationLanguageContentEntityTest.

Class

LanguageNegotiationContentEntityTest
Tests language negotiation with the language negotiator content entity.

Namespace

Drupal\language\Tests

Code

protected function createTranslatableEntity() {
  $this->entity = EntityTest::create();
  $this->entity
    ->addTranslation('es', [
    'name' => 'name spanish',
  ]);
  $this->entity
    ->addTranslation('fr', [
    'name' => 'name french',
  ]);
  $this->entity
    ->save();
}