protected function DrupalWebTestCase::drupalGet

Retrieves a Drupal path or an absolute path.


$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()

533 calls to DrupalWebTestCase::drupalGet()
AccessDeniedTestCase::testAccessDenied in drupal/modules/system/system.test
ActionLoopTestCase::triggerActions in drupal/modules/simpletest/tests/actions.test
Create an infinite loop by causing a watchdog message to be set, which causes the actions to be triggered again, up to actions_max_stack times.
ActionsConfigurationTestCase::testActionConfiguration in drupal/modules/simpletest/tests/actions.test
Test the configuration of advanced actions through the administration interface.
AddFeedTestCase::testAddFeed in drupal/modules/aggregator/aggregator.test
Creates and ensures that a feed is unique, checks source, and deletes feed.
AddFeedTestCase::testAddLongFeed in drupal/modules/aggregator/aggregator.test
Tests feeds with very long URLs.

... See full list


drupal/modules/simpletest/drupal_web_test_case.php, line 1978


Test case for typical Drupal tests.


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
    CURLOPT_URL => url($path, $options),
    CURLOPT_HTTPHEADER => $headers,

  // 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;
    ->verbose('GET request to: ' . $path . '<hr />Ending URL: ' . $this
    ->getUrl() . '<hr />' . $out);
  return $out;