function InstallerTest::testInstaller

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

Ensures that the user page is available after installation.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerTest.php, line 29

Class

InstallerTest
Tests the interactive installer.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testInstaller() : void {
  $this->assertNotEquals('0', \Drupal::service('asset.query_string')->get(), 'The dummy query string should be set during install');
  $this->assertSession()
    ->addressEquals('user/1');
  $this->assertSession()
    ->statusCodeEquals(200);
  // Confirm that we are logged-in after installation.
  $this->assertSession()
    ->pageTextContains($this->rootUser
    ->getAccountName());
  // Verify that the confirmation message appears.
  require_once $this->root . '/core/includes/install.inc';
  $this->assertSession()
    ->pageTextContains('Congratulations, you installed Drupal!');
  // Ensure that the timezone is correct for sites under test after installing
  // interactively.
  $this->assertEquals('Australia/Sydney', $this->config('system.date')
    ->get('timezone.default'));
  // Ensure the profile has a weight of 1000.
  $module_extension_list = \Drupal::service('extension.list.module');
  $extensions = $module_extension_list->getList();
  $this->assertArrayHasKey('testing', $extensions);
  $this->assertEquals(1000, $extensions['testing']->weight);
  // Ensures that router is not rebuilt unnecessarily during the install.
  $this->assertSame(1, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
}

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