protected function WebTestBase::drupalGet

Retrieves 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 HTML string, also available as $this->drupalGetContent()

576 calls to WebTestBase::drupalGet()
AccessDeniedTest::testAccessDenied in drupal/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
AddFeedTest::testAddFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AddFeedTest.php
Create a feed, ensure that it is unique, check the source, and delete the feed.
AddFeedTest::testAddLongFeed in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AddFeedTest.php
Tests feeds with very long URLs.
AdminMetaTagTest::testMetaTag in drupal/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php
Verify that the meta tag HTML is generated correctly.
AdminTest::testAdminPages in drupal/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
Tests output on administrative listing pages.

... See full list

File

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

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function drupalGet($path, array $options = array(), array $headers = array()) {
  $options['absolute'] = TRUE;

  // We re-using a CURL connection here. If that connection still has certain
  // options set, it might change the GET into a POST. Make sure we clear out
  // previous options.
  $out = $this
    ->curlExec(array(
    CURLOPT_HTTPGET => TRUE,
    CURLOPT_URL => url($path, $options),
    CURLOPT_NOBODY => FALSE,
    CURLOPT_HTTPHEADER => $headers,
  ));
  $this
    ->refreshVariables();

  // Ensure that any changes to variables in the other thread are picked up.
  // Replace original page output with new output from redirected page(s).
  if ($new = $this
    ->checkForMetaRefresh()) {
    $out = $new;
  }
  $this
    ->verbose('GET request to: ' . $path . '<hr />Ending URL: ' . $this
    ->getUrl() . '<hr />' . $out);
  return $out;
}