InstallerPerformanceTest.php 1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

namespace Drupal\FunctionalTests\Installer;

use Drupal\Core\Routing\RoutingEvents;
use Drupal\Core\Test\PerformanceTestRecorder;
use Drupal\Tests\BrowserTestBase;

/**
 * Tests the interactive installer.
 *
 * @group Installer
 */
class InstallerPerformanceTest extends BrowserTestBase {

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected $profile = 'testing';

  /**
   * {@inheritdoc}
   */
  protected function prepareSettings() {
    parent::prepareSettings();
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', FALSE);
  }

  /**
   * Ensures that the user page is available after installation.
   */
  public function testInstaller() {
    // Ensures that router is not rebuilt unnecessarily during the install.
39
40
    // Currently it is built once during the install in install_finished().
    $this->assertSame(1, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
41
42
43
  }

}