You are here

public function ContentEntityReferenceTest::testReferencedEntityCreated in Entity Share 8.2

Test that a referenced entity is pulled even if not selected.

File

modules/entity_share_client/tests/src/Functional/ContentEntityReferenceTest.php, line 86

Class

ContentEntityReferenceTest
Functional test class for content entity reference field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

public function testReferencedEntityCreated() {

  // Select only the referencing entity.
  $selected_entities = [
    'es_test_content_reference',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this->jsonapiHelper
    ->setRemote($this->remote);
  $http_client = $this->remoteManager
    ->prepareJsonApiClient($this->remote);
  $response = $this->requestService
    ->request($http_client, 'GET', $prepared_url);
  $json = Json::decode((string) $response
    ->getBody());
  $this->jsonapiHelper
    ->importEntityListData(EntityShareUtility::prepareData($json['data']));
  $this
    ->checkCreatedEntities();
}