You are here

function SimpleTestFunctionalTest::inCURL in SimpleTest 6.2

Same name and namespace in other branches
  1. 7.2 simpletest.test \SimpleTestFunctionalTest::inCURL()
  2. 7 simpletest.test \SimpleTestFunctionalTest::inCURL()

Check if the test is being run from inside a CURL request.

3 calls to SimpleTestFunctionalTest::inCURL()
SimpleTestFunctionalTest::setUp in ./simpletest.test
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
SimpleTestFunctionalTest::testInternalBrowser in ./simpletest.test
Test the internal browsers functionality.
SimpleTestFunctionalTest::testWebTestRunner in ./simpletest.test
Make sure that tests selected through the web interface are run and that the results are displayed correctly.

File

./simpletest.test, line 275

Class

SimpleTestFunctionalTest

Code

function inCURL() {

  // We cannot rely on drupal_static('drupal_test_info') here, because
  // 'in_child_site' would be FALSE for the parent site when we are
  // executing the tests. Default to direct detection of the HTTP headers.
  return isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/^simpletest\\d+/", $_SERVER['HTTP_USER_AGENT']);
}