From 6e82d23e9717a55417fe53a478aff2d80698d2f0 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Fri, 23 Apr 2010 05:46:01 +0000
Subject: [PATCH] #758690 by solotandem: Set the user agent for Unit Test Case
 for consistency with Web Test Case.

---
 modules/simpletest/drupal_web_test_case.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index 2db22c06ba05..25e6b3972b60 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -575,6 +575,9 @@ protected function setUp() {
     $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();
-- 
GitLab