protected function WebTestBase::drupalHead

Retrieves only the headers for a Drupal path or an absolute path.

Parameters

$path: Drupal path or URL to load into internal browser

$options: Options to be forwarded to url().

$headers: An array containing additional HTTP request headers, each formatted as "name: value".

Return value

The retrieved headers, also available as $this->drupalGetContent()

3 calls to WebTestBase::drupalHead()
DownloadTest::testPrivateFileTransfer in drupal/core/modules/file/lib/Drupal/file/Tests/DownloadTest.php
Test the private file transfer system.
DownloadTest::testPublicFileTransfer in drupal/core/modules/file/lib/Drupal/file/Tests/DownloadTest.php
Test the public file transfer system.
PageCacheTest::testConditionalRequests in drupal/core/modules/system/lib/Drupal/system/Tests/Bootstrap/PageCacheTest.php
Tests support of requests with If-Modified-Since and If-None-Match headers.

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php, line 1490
Definition of Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalHead($path, array $options = array(), array $headers = array()) {
  $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.
  return $out;
}