You are here

protected function BlockFieldTest::populateRequestService in Entity Share 8.3

Same name and namespace in other branches
  1. 8.2 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 155

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);
  $this->remoteManager
    ->jsonApiRequest($this->remote, 'GET', $url
    ->toString());
}