You are here

protected function ContentEntityReferenceTest::populateRequestService in Entity Share 8.3

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

Helper function to populate the request service with responses.

Overrides EntityShareClientFunctionalTestBase::populateRequestService

File

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

Class

ContentEntityReferenceTest
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 the referencing content will be
  // required.
  $selected_entities = [
    'es_test_level_0',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this
    ->discoverJsonApiEndpoints($prepared_url);

  // Do the same for the cases when some other nodes are filtered by.
  $selected_entities = [
    'es_test_level_2',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this
    ->discoverJsonApiEndpoints($prepared_url);
  $selected_entities = [
    'es_test_level_3',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this
    ->discoverJsonApiEndpoints($prepared_url);
}