You are here

protected function LinkFieldTest::populateRequestService in Entity Share 8.3

Helper function to populate the request service with responses.

Overrides EntityShareClientFunctionalTestBase::populateRequestService

File

modules/entity_share_client/tests/src/Functional/LinkFieldTest.php, line 195

Class

LinkFieldTest
Functional test class for link field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

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

  // Needs to make the requests when only the linking content will be
  // required.
  $selected_entities = [
    'es_test_link_internal',
  ];
  $prepared_url = $this
    ->prepareUrlFilteredOnUuids($selected_entities, 'node_es_test_en');
  $this
    ->discoverJsonApiEndpoints($prepared_url);

  // Prepare the request on the linked content.
  $route_name = sprintf('jsonapi.%s--%s.individual', 'node', 'es_test');
  $linked_content_url = Url::fromRoute($route_name, [
    'entity' => 'es_test',
  ])
    ->setOption('language', $this->container
    ->get('language_manager')
    ->getLanguage('en'))
    ->setOption('absolute', TRUE);
  $this
    ->discoverJsonApiEndpoints($linked_content_url
    ->toString());
}