summaryrefslogtreecommitdiff
path: root/modules/simpletest/simpletest.test
diff options
context:
space:
mode:
Diffstat (limited to 'modules/simpletest/simpletest.test')
-rw-r--r--modules/simpletest/simpletest.test5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test
index b3522f962..13cd5ae42 100644
--- a/modules/simpletest/simpletest.test
+++ b/modules/simpletest/simpletest.test
@@ -272,10 +272,11 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
/**
* Check if the test is being run from inside a CURL request.
- *
- * @return The test is being run from inside a CURL request.
*/
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']);
}
}