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. 10 core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::request()
  3. 11.x core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php \Drupal\Tests\layout_builder\Functional\Rest\LayoutRestTestBase::request()

Overrides ResourceTestBase::request

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 97

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 = []) {
    $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.