InstallerPostInstallTest.php 1.03 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
39
40
<?php

namespace Drupal\FunctionalTests\Installer;

/**
 * Tests re-visiting the installer after a successful installation.
 *
 * @group Installer
 */
class InstallerPostInstallTest extends InstallerTestBase {

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

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

  /**
   * Confirms that visiting the installer does not break things post-install.
   */
  public function testVisitInstallerPostInstall() {
    \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->assertText('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->assertText('minimal');
  }

}