You are here

public function MultilingualTest::testDefaultTranslationFirstPull in Entity Share 8.2

Test pulling content in its default translation first.

File

modules/entity_share_client/tests/src/Functional/MultilingualTest.php, line 92

Class

MultilingualTest
General functional test class for multilingual scenarios.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

public function testDefaultTranslationFirstPull() {
  $this
    ->pullChannel('node_es_test_en');
  $this
    ->pullChannel('node_es_test_fr');
  $this
    ->checkCreatedEntities();

  /** @var \Drupal\node\NodeInterface $node */
  $node = $this
    ->loadEntity('node', 'es_test');
  $node_translation = $node
    ->getTranslation('en');
  $this
    ->assertTrue($node_translation
    ->isDefaultTranslation(), 'The node default translation is the same as the initial one as it had been pulled in its default language first.');
}