function AssertLegacyTrait::assertHeader

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php \Drupal\FunctionalTests\AssertLegacyTrait::assertHeader()

Checks that current response header equals value.

Parameters

string $name: Name of header to assert.

string $value: Value of the header to assert

Deprecated

in drupal:8.3.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderEquals() instead.

See also

https://www.drupal.org/node/3129738

1 call to AssertLegacyTrait::assertHeader()
BrowserTestBaseTest::testAssertHeader in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests legacy assertHeader().

File

core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php, line 892

Class

AssertLegacyTrait
Provides convenience methods for assertions in browser tests.

Namespace

Drupal\FunctionalTests

Code

protected function assertHeader($name, $value) {
    @trigger_error('AssertLegacyTrait::assertHeader() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseHeaderEquals() instead. See https://www.drupal.org/node/3129738', E_USER_DEPRECATED);
    $this->assertSession()
        ->responseHeaderEquals($name, $value);
}

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