X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fredirect%2Fsrc%2FTests%2FGlobalRedirectTest.php;h=75e1f99871aaabe83eb8458340acb17578b80a0d;hp=c457f82cc22bc0b1aaf2c2033335b89d77478b63;hb=059867c3f96750652c80f39e44c442a58c2549ee;hpb=f8fc16ae6b862bef59baaad5d051dd37b7ff11b2 diff --git a/web/modules/contrib/redirect/src/Tests/GlobalRedirectTest.php b/web/modules/contrib/redirect/src/Tests/GlobalRedirectTest.php index c457f82cc..75e1f9987 100644 --- a/web/modules/contrib/redirect/src/Tests/GlobalRedirectTest.php +++ b/web/modules/contrib/redirect/src/Tests/GlobalRedirectTest.php @@ -273,4 +273,24 @@ class GlobalRedirectTest extends WebTestBase { $this->assertEqual($headers[0][':status'], $expected_ending_status); } + + /** + * @inheritdoc} + */ + protected function drupalHead($path, array $options = [], array $headers = []) { + // Always just use getAbsolutePath() so that generating the link does not + // alter special requests. + $url = $this->getAbsoluteUrl($path); + $out = $this->curlExec([CURLOPT_NOBODY => TRUE, CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $headers]); + // Ensure that any changes to variables in the other thread are picked up. + $this->refreshVariables(); + + if ($this->dumpHeaders) { + $this->verbose('GET request to: ' . $path . + '
Ending URL: ' . $this->getUrl() . + '
Headers:
' . Html::escape(var_export(array_map('trim', $this->headers), TRUE)) . '
'); + } + + return $out; + } }