You are here

protected function BlockFieldTest::populateRequestService in Entity Share 8.2

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

Helper function to populate the request service with responses.

Overrides EntityShareClientFunctionalTestBase::populateRequestService

File

modules/entity_share_client/tests/src/Functional/BlockFieldTest.php, line 125

Class

BlockFieldTest
Functional test class for block field.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

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

  // Request the /jsonapi/block_content/es_test/block_content_test URL.
  $route_name = sprintf('jsonapi.%s--%s.individual', 'block_content', 'es_test');
  $url = Url::fromRoute($route_name, [
    'entity' => 'block_content_test',
  ])
    ->setOption('language', $this->container
    ->get('language_manager')
    ->getLanguage('en'))
    ->setOption('absolute', TRUE);
  $http_client = $this->remoteManager
    ->prepareJsonApiClient($this->remote);
  $this->requestService
    ->request($http_client, 'GET', $url
    ->toString());
}