function BrowserTestBase::drupalGetHeader

Same name in other branches
  1. 9 core/tests/Drupal/Tests/BrowserTestBase.php \Drupal\Tests\BrowserTestBase::drupalGetHeader()

Gets the value of an HTTP response header.

If multiple requests were required to retrieve the page, only the headers from the last request will be checked by default.

Parameters

string $name: The name of the header to retrieve. Names are case-insensitive (see RFC 2616 section 4.2).

Return value

string|null The HTTP header value or NULL if not found.

46 calls to BrowserTestBase::drupalGetHeader()
AggregatorRenderingTest::testBlockLinks in core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php
Adds a feed block to the page and checks its links.
AggregatorRenderingTest::testFeedPage in core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php
Creates a feed and checks that feed's page.
BasicAuthTest::testBasicAuth in core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
Test http basic authentication.
BigPipeTest::assertBigPipeNoJsPlaceholders in core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
Asserts expected BigPipe no-JS placeholders are present and replaced.
BigPipeTest::assertBigPipePlaceholders in core/modules/big_pipe/tests/src/Functional/BigPipeTest.php
Asserts expected BigPipe placeholders are present and replaced.

... See full list

File

core/tests/Drupal/Tests/BrowserTestBase.php, line 681

Class

BrowserTestBase
Provides a test case for functional Drupal tests.

Namespace

Drupal\Tests

Code

protected function drupalGetHeader($name) {
    return $this->getSession()
        ->getResponseHeader($name);
}

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