function InstallerRouterTest::testInstalled

Same name in other branches
  1. 10 core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php \Drupal\FunctionalTests\Installer\InstallerRouterTest::testInstalled()
  2. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php \Drupal\FunctionalTests\Installer\InstallerRouterTest::testInstalled()

Confirms that the installation succeeded.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerRouterTest.php, line 53

Class

InstallerRouterTest
Tests router rebuilding during installation.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testInstalled() {
    $this->assertSession()
        ->statusCodeEquals(200);
    // Ensures that router is not rebuilt unnecessarily during the install. It
    // is rebuilt during:
    // - router_test_install()
    // - router_installer_test_modules_installed()
    // - install_finished()
    $this->assertSame(3, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
    $this->assertStringEndsWith('/core/install.php/router_installer_test/test1', \Drupal::state()->get('router_installer_test_modules_installed'));
    $this->assertStringEndsWith('/core/install.php/router_test/test1', \Drupal::state()->get('router_test_install'));
}

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