protected function BrowserHtmlDebugTrait::formatHtmlOutputHeaders in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php \Drupal\Tests\BrowserHtmlDebugTrait::formatHtmlOutputHeaders()
- 9 core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php \Drupal\Tests\BrowserHtmlDebugTrait::formatHtmlOutputHeaders()
Formats HTTP headers as string for HTML output logging.
Parameters
array[] $headers: Headers that should be formatted.
Return value
string The formatted HTML string.
File
- core/
tests/ Drupal/ Tests/ BrowserHtmlDebugTrait.php, line 84
Class
- BrowserHtmlDebugTrait
- Provides the debug functions for browser tests.
Namespace
Drupal\TestsCode
protected function formatHtmlOutputHeaders(array $headers) {
$flattened_headers = array_map(function ($header) {
if (is_array($header)) {
return implode(';', array_map('trim', $header));
}
else {
return $header;
}
}, $headers);
return '<hr />Headers: <pre>' . Html::escape(var_export($flattened_headers, TRUE)) . '</pre>';
}