diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index a75ade4..cfe2330 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -54,6 +54,13 @@ protected $headers; /** + * Indicates that headers should be dumped if verbose output is enabled. + * + * @var bool + */ + protected $dumpHeaders = FALSE; + + /** * The content of the page currently loaded in the internal browser. * * @var string @@ -1191,9 +1198,15 @@ protected function drupalGet($path, array $options = array(), array $headers = a if ($new = $this->checkForMetaRefresh()) { $out = $new; } - $this->verbose('GET request to: ' . $path . - '
Ending URL: ' . $this->getUrl() . - '
' . $out); + + $verbose = 'GET request to: ' . $path . + '
Ending URL: ' . $this->getUrl(); + if ($this->dumpHeaders) { + $verbose .= '
Headers:
' . check_plain(var_export($this->headers, TRUE)) . '
'; + } + $verbose .= '
' . $out; + + $this->verbose($verbose); return $out; } @@ -1633,6 +1646,13 @@ protected function drupalHead($path, array $options = array(), array $headers = $options['absolute'] = TRUE; $out = $this->curlExec(array(CURLOPT_NOBODY => TRUE, CURLOPT_URL => url($path, $options), CURLOPT_HTTPHEADER => $headers)); $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up. + + if ($this->dumpHeaders) { + $this->verbose('GET request to: ' . $path . + '
Ending URL: ' . $this->getUrl() . + '
Headers:
' . check_plain(var_export($this->headers, TRUE)) . '
'); + } + return $out; }