X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FTest%2FTestSetupTrait.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FTest%2FTestSetupTrait.php;h=44409078dbf3854670711937948c404d887beb36;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=ea9137e479767669ed12c6f3ca0c56366e75a45b;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Test/TestSetupTrait.php b/web/core/lib/Drupal/Core/Test/TestSetupTrait.php index ea9137e47..44409078d 100644 --- a/web/core/lib/Drupal/Core/Test/TestSetupTrait.php +++ b/web/core/lib/Drupal/Core/Test/TestSetupTrait.php @@ -141,7 +141,7 @@ trait TestSetupTrait { * @see \Drupal\simpletest\TestBase::prepareEnvironment() * @see drupal_valid_test_ua() */ - private function prepareDatabasePrefix() { + protected function prepareDatabasePrefix() { $test_db = new TestDatabase(); $this->siteDirectory = $test_db->getTestSitePath(); $this->databasePrefix = $test_db->getDatabasePrefix(); @@ -150,7 +150,7 @@ trait TestSetupTrait { /** * Changes the database connection to the prefixed one. */ - private function changeDatabasePrefix() { + protected function changeDatabasePrefix() { if (empty($this->databasePrefix)) { $this->prepareDatabasePrefix(); } @@ -158,7 +158,7 @@ trait TestSetupTrait { // If the test is run with argument dburl then use it. $db_url = getenv('SIMPLETEST_DB'); if (!empty($db_url)) { - $database = Database::convertDbUrlToConnectionInfo($db_url, DRUPAL_ROOT); + $database = Database::convertDbUrlToConnectionInfo($db_url, isset($this->root) ? $this->root : DRUPAL_ROOT); Database::addConnectionInfo('default', 'default', $database); }