You are here

public function MultilingualTest::testNonDefaultTranslationFirstPull in Entity Share 8.2

Test pulling content NOT in its default translation first.

File

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

Class

MultilingualTest
General functional test class for multilingual scenarios.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

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

  /** @var \Drupal\node\NodeInterface $node */
  $node = $this
    ->loadEntity('node', 'es_test');
  $node_translation = $node
    ->getTranslation('fr');
  $this
    ->assertTrue($node_translation
    ->isDefaultTranslation(), 'The node default translation has changed as it had been pulled in another language first.');
}