public function BrowserTestBaseTest::testAssertHeader in Drupal 9
Tests legacy assertHeader().
@group legacy
File
- core/
tests/ Drupal/ FunctionalTests/ BrowserTestBaseTest.php, line 287
Class
- BrowserTestBaseTest
- Tests BrowserTestBase functionality.
Namespace
Drupal\FunctionalTestsCode
public function testAssertHeader() {
$this
->expectDeprecation('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');
$account = $this
->drupalCreateUser();
$this
->drupalLogin($account);
$this
->drupalGet('test-page');
$this
->assertHeader('X-Drupal-Cache-Tags', 'http_response rendered');
}