// Response includes cache tags that we can assert.
$this->assertSession()->responseHeaderExists('X-Drupal-Cache-Tags'); $this->assertSession()->responseHeaderEquals('X-Drupal-Cache-Tags', 'http_response rendered');
// Test that we can read the JS settings.
$js_settings = $this->getDrupalSettings(); $this->assertSame('azAZ09();.,\\\/-_{}', $js_settings['test-setting']);
$this->expectException(AssertionFailedError::class); $this->expectExceptionMessage("Failed asserting that the response has a 'does-not-exist' header."); $this->assertSession()->responseHeaderExists('does-not-exist'); }