Skip to content
Snippets Groups Projects
Commit 6e82d23e authored by Angie Byron's avatar Angie Byron
Browse files

#758690 by solotandem: Set the user agent for Unit Test Case for consistency with Web Test Case.

parent 3622e5f7
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -575,6 +575,9 @@ protected function setUp() { ...@@ -575,6 +575,9 @@ protected function setUp() {
$db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}'); $db_prefix = Database::getConnection()->prefixTables('{simpletest' . mt_rand(1000, 1000000) . '}');
$conf['file_public_path'] = $this->originalFileDirectory . '/' . $db_prefix; $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 // If locale is enabled then t() will try to access the database and
// subsequently will fail as the database is not accessible. // subsequently will fail as the database is not accessible.
$module_list = module_list(); $module_list = module_list();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment