diff -u b/core/includes/install.core.inc b/core/includes/install.core.inc --- b/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -436,7 +436,7 @@ $task = NULL; // Do not install over a configured settings.php. - if (!empty($GLOBALS['databases']) && !drupal_valid_test_ua()) { + if (!empty($GLOBALS['databases'])) { throw new Exception(install_already_done_error()); } } @@ -1079,9 +1079,8 @@ $database['namespace'] = substr($install_namespace, 0, strrpos($install_namespace, '\\')); $database['driver'] = $driver; - // TODO: remove when PIFR will be updated to use 'db_prefix' instead of - // 'prefix' in the database settings form with the non-interactive - // installer. + // TODO: PIFR uses 'db_prefix' instead of 'prefix'. Remove this when it gets + // fixed. if (!$test_prefix) { $database['prefix'] = $database['db_prefix']; } @@ -1146,8 +1145,14 @@ // Update global settings array and save. $settings = array(); $database = $form_state['storage']['database']; + // Ideally, there is no difference between the code executed by the + // automated test browser and an ordinary browser. However, the database + // settings need a different format and also need to skip the password + // when testing. The hash salt also needs to be skipped because the original + // salt is used to verify the validity of the automated test browser. + // Because of these, there's a little difference in the code following but + // it is small and self-contained. if ($test_prefix = drupal_valid_test_ua()) { - // This is test specific code, however it is very small and contained. foreach ($form_state['storage']['database'] as $k => $v) { if ($k != 'password') { $settings['databases']['default']['default'][$k] = (object) array( @@ -1158,15 +1163,10 @@ } } else { - // Because of the test specific code above, this assignment here must be - // kept simple and must not call any functions to avoid creating a tested - // and a non-tested code path. $settings['databases']['default']['default'] = (object) array( 'value' => $database, 'required' => TRUE, ); - // Tests must not override the hash salt so that the user agent can be - // verified. $settings['drupal_hash_salt'] = (object) array( 'value' => drupal_hash_base64(drupal_random_bytes(55)), 'required' => TRUE, diff -u b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php --- b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php @@ -102,8 +102,8 @@ config('system.mail')->set('interface.default', 'Drupal\Core\Mail\VariableLog')->save(); drupal_set_time_limit($this->timeLimit); - // Temporary fix so that when running from run-tests.sh we don't get an - // empty current path which would indicate we're on the home page. + // When running from run-tests.sh we don't get an mpty current path which + // would indicate we're on the home page. $path = current_path(); if (empty($path)) { _current_path('run-tests'); @@ -112,10 +112,11 @@ } /** - * Overrides \Drupal\simpletest\WebTestBase::drupalGet(). + * Overrides \Drupal\simpletest\WebTestBase::refreshVariables(). * - * @todo - * Why do we need to override this? + * During setup(), drupalPost costs refreshVariables which tries to read + * variables which are not yet there because the child Drupal is not yet + * installed. */ protected function refreshVariables() { if (!empty($this->setup)) { @@ -127,11 +128,10 @@ * Overrides \Drupal\simpletest\WebTestBase::drupalGet(). * * This override is necessary because the parent drupalGet() calls t(), which - * is not availble early during installation. + * is not available early during installation. */ protected function drupalGet($path, array $options = array(), array $headers = array()) { - - // We are re-using a CURL connection here. If that connection still has + // We are re-using a CURL connection here. If that connection still has // certain options set, it might change the GET into a POST. Make sure we // clear out previous options. $out = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => $this->getAbsoluteUrl($path), CURLOPT_NOBODY => FALSE, CURLOPT_HTTPHEADER => $headers)); only in patch2: unchanged: --- a/core/includes/errors.inc +++ b/core/includes/errors.inc @@ -136,7 +136,9 @@ function _drupal_decode_exception($exception) { * An error message. */ function _drupal_render_exception_safe($exception) { - return check_plain(strtr('%type: !message in %function (line %line of %file).', _drupal_decode_exception($exception))); + $decode = _drupal_decode_exception($exception); + unset($decode['backtrace']); + return check_plain(strtr('%type: !message in %function (line %line of %file).', $decode)); } /**