function DistributionProfileExistingSettingsTest::setUpLanguage

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php \Drupal\FunctionalTests\Installer\DistributionProfileExistingSettingsTest::setUpLanguage()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php \Drupal\FunctionalTests\Installer\DistributionProfileExistingSettingsTest::setUpLanguage()
  3. 10 core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php \Drupal\FunctionalTests\Installer\DistributionProfileExistingSettingsTest::setUpLanguage()

Overrides InstallerTestBase::setUpLanguage

File

core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php, line 83

Class

DistributionProfileExistingSettingsTest
Tests distribution profile support with existing settings.

Namespace

Drupal\FunctionalTests\Installer

Code

protected function setUpLanguage() : void {
    // Make settings file not writable.
    $filename = $this->siteDirectory . '/settings.php';
    // Make the settings file read-only.
    // Not using File API; a potential error must trigger a PHP warning.
    chmod($filename, 0444);
    // Verify that the distribution name appears.
    $this->assertSession()
        ->pageTextContains($this->info['distribution']['name']);
    // Verify that the requested theme is used.
    $this->assertSession()
        ->responseContains($this->info['distribution']['install']['theme']);
    // Verify that the "Choose profile" step does not appear.
    $this->assertSession()
        ->pageTextNotContains('profile');
    parent::setUpLanguage();
}

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