function InstallerExistingInstallationTest::testInstaller

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php \Drupal\FunctionalTests\Installer\InstallerExistingInstallationTest::testInstaller()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php \Drupal\FunctionalTests\Installer\InstallerExistingInstallationTest::testInstaller()
  3. 10 core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php \Drupal\FunctionalTests\Installer\InstallerExistingInstallationTest::testInstaller()

Tests that Drupal fails to install when there is an existing installation.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerExistingInstallationTest.php, line 22

Class

InstallerExistingInstallationTest
Tests the installer with an existing Drupal installation.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testInstaller() : void {
    // Verify that Drupal can't be immediately reinstalled.
    $this->visitInstaller();
    $this->assertSession()
        ->pageTextContains('Drupal already installed');
    // Verify that Drupal version is not displayed.
    $this->assertSession()
        ->pageTextNotContains(\Drupal::VERSION);
    // Delete settings.php and attempt to reinstall again.
    unlink($this->siteDirectory . '/settings.php');
    $this->visitInstaller();
    $this->setUpLanguage();
    $this->setUpProfile();
    $this->setUpRequirementsProblem();
    $this->setUpSettings();
    $this->assertSession()
        ->pageTextContains('Drupal already installed');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.