You are here

protected function InfiniteLoopTest::populateRequestService in Entity Share 8.2

Same name and namespace in other branches
  1. 8.3 modules/entity_share_client/tests/src/Functional/InfiniteLoopTest.php \Drupal\Tests\entity_share_client\Functional\InfiniteLoopTest::populateRequestService()

Helper function to populate the request service with responses.

Overrides EntityShareClientFunctionalTestBase::populateRequestService

File

modules/entity_share_client/tests/src/Functional/InfiniteLoopTest.php, line 113

Class

InfiniteLoopTest
Functional test class for content entity reference field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function populateRequestService() {
  parent::populateRequestService();

  // Needs to make the requests when only one referencing content will be
  // required.
  $selected_entities = [
    'es_test_content_reference_one',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this->jsonapiHelper
    ->setRemote($this->remote);
  $http_client = $this->remoteManager
    ->prepareJsonApiClient($this->remote);
  $this
    ->discoverJsonApiEndpoints($http_client, $prepared_url);

  // Needs to make the requests when only one referencing content will be
  // required.
  $selected_entities = [
    'es_test_content_reference_two',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this->jsonapiHelper
    ->setRemote($this->remote);
  $http_client = $this->remoteManager
    ->prepareJsonApiClient($this->remote);
  $this
    ->discoverJsonApiEndpoints($http_client, $prepared_url);
}