function LayoutRestTestBase::request

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::request()
  2. 8.9.x core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::request()
  3. 10 core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::request()

Overrides ApiRequestTrait::makeApiRequest

1 call to LayoutRestTestBase::request()
OverrideSectionsTest::testOverrideField in core/modules/layout_builder/tests/src/Functional/Rest/OverrideSectionsTest.php
Tests that the layout override field is not normalized.

File

core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php, line 95

Class

LayoutRestTestBase
Base class for Layout Builder REST tests.

Namespace

Drupal\Tests\layout_builder\Functional\Rest

Code

protected function request($method, Url $url, array $request_options = []) : ResponseInterface {
    $request_options[RequestOptions::HEADERS] = [
        'Content-Type' => static::$mimeType,
    ];
    $request_options = NestedArray::mergeDeep($request_options, $this->getAuthenticationRequestOptions($method));
    $request_options[RequestOptions::QUERY] = [
        '_format' => static::$format,
    ];
    return parent::request($method, $url, $request_options);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.