diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index eeca310..04a8da4 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -274,9 +274,9 @@ function install_begin_request(&$install_state) { drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); // If the hash salt leaks, it becomes possible to forge a valid testing user - // agent, install a new Drupal and take over the oirginal site. To avoid - // this yet allow for automated testing of the installer, make sure there is - // also a special test specific settings.php overriding conf_path(). + // agent, install a new copy of Drupal, and take over the original site. To + // avoid this yet allow for automated testing of the installer, make sure + // there is also a special test-specific settings.php overriding conf_path(). // _drupal_load_test_overrides() sets the simpletest_conf_path in-memory // setting in this case. if ($install_state['interactive'] && drupal_valid_test_ua() && !settings()->get('simpletest_conf_path')) { diff --git a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php index 2b8259e..0df16f7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/InstallerTest.php @@ -10,7 +10,11 @@ use Drupal\Component\Utility\NestedArray; use Drupal\simpletest\WebTestBase; +/** + * Allows testing of the interactive installer. + */ class InstallerTest extends WebTestBase { + public static function getInfo() { return array( 'name' => 'Installer tests', @@ -22,11 +26,11 @@ public static function getInfo() { protected function setUp() { global $conf; - // When running tests through the Simpletest UI (vs. on the command line), - // Simpletest's batch conflicts with the installer's batch. Batch API does + // When running tests through the SimpleTest UI (vs. on the command line), + // SimpleTest's batch conflicts with the installer's batch. Batch API does // not support the concept of nested batches (in which the nested is not // progressive), so we need to temporarily pretend there was no batch. - // Backup the currently running Simpletest batch. + // Back up the currently running SimpleTest batch. $this->originalBatch = batch_get(); // Create the database prefix for this test. @@ -107,6 +111,12 @@ protected function setUp() { $this->setup = TRUE; } + /** + * Overrides \Drupal\simpletest\WebTestBase::drupalGet(). + * + * @todo + * Why do we need to override this? + */ protected function refreshVariables() { if (!empty($this->setup)) { parent::refreshVariables(); @@ -116,14 +126,14 @@ protected function refreshVariables() { /** * Overrides \Drupal\simpletest\WebTestBase::drupalGet(). * - * This override is necessary because the parent drupalGet() calls t() which - * is not working in early install. + * This override is necessary because the parent drupalGet() calls t(), which + * is not availble early during installation. */ protected function drupalGet($path, array $options = array(), array $headers = array()) { - // We 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. + // 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)); $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up. @@ -137,6 +147,10 @@ protected function drupalGet($path, array $options = array(), array $headers = a return $out; } + + /** + * Ensures that the user page is available after every test installation. + */ function testInstaller() { $this->drupalGet('user'); }