function DrupalWebTestCase::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()

252 calls to DrupalWebTestCase::drupalGet()
AJAXFormPageCacheTestCase::testSimpleAJAXFormValue in modules/simpletest/tests/ajax.test
Create a simple form, then POST to system/ajax to change to it.
AJAXFrameworkTestCase::testAJAXRender in modules/simpletest/tests/ajax.test
Test that ajax_render() returns JavaScript settings generated during the page request.
AJAXFrameworkTestCase::testLazyLoad in modules/simpletest/tests/ajax.test
Test that new JavaScript and CSS files added during an AJAX request are returned.
AJAXMultiFormTestCase::testMultiForm in modules/simpletest/tests/ajax.test
Test that a page with the 'page_node_form' included twice works correctly.
BasicMinimalUpdatePath::testBasicMinimalUpdate in modules/simpletest/tests/upgrade/upgrade.test
Tests a successful point release update.

... See full list

File

modules/simpletest/drupal_web_test_case.php, line 2265

Class

DrupalWebTestCase
Test case for typical Drupal tests.

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.