summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngie Byron2010-04-23 05:46:01 (GMT)
committerAngie Byron2010-04-23 05:46:01 (GMT)
commit6e82d23e9717a55417fe53a478aff2d80698d2f0 (patch)
treeb597436fffc5ac90558e5411cf71a6f347460f3e
parent3622e5f7a83bc70229d8e2d71473032c5cf4823b (diff)
#758690 by solotandem: Set the user agent for Unit Test Case for consistency with Web Test Case.
-rw-r--r--modules/simpletest/drupal_web_test_case.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 2db22c0..25e6b39 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -575,6 +575,9 @@ class DrupalUnitTestCase extends DrupalTestCase {
$db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}');
$conf['file_public_path'] = $this->originalFileDirectory . '/' . $db_prefix;
+ // Set user agent to be consistent with web test case.
+ $_SERVER['HTTP_USER_AGENT'] = $db_prefix;
+
// If locale is enabled then t() will try to access the database and
// subsequently will fail as the database is not accessible.
$module_list = module_list();