function InstallerPostInstallTest::testVisitInstallerPostInstall

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

Confirms that visiting the installer does not break things post-install.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerPostInstallTest.php, line 27

Class

InstallerPostInstallTest
Tests re-visiting the installer after a successful installation.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testVisitInstallerPostInstall() : void {
  \Drupal::service('module_installer')->install([
    'system_test',
  ]);
  // Clear caches to ensure that system_test's routes are available.
  $this->resetAll();
  // Confirm that the install_profile is correct.
  $this->drupalGet('/system-test/get-install-profile');
  $this->assertSession()
    ->pageTextContains('minimal');
  // Make an anonymous visit to the installer
  $this->drupalLogout();
  $this->visitInstaller();
  // Ensure that the install profile is still correct.
  $this->drupalGet('/system-test/get-install-profile');
  $this->assertSession()
    ->pageTextContains('minimal');
}

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