function UpdatePathTestBase::prepareSettings

Same name in this branch
  1. 8.9.x core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::prepareSettings()
Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::prepareSettings()
  2. 10 core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::prepareSettings()
  3. 11.x core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php \Drupal\FunctionalTests\Update\UpdatePathTestBase::prepareSettings()

Add settings that are missed since the installer isn't run.

Overrides FunctionalTestSetupTrait::prepareSettings

1 call to UpdatePathTestBase::prepareSettings()
UpdatePathTestBase::setUp in core/modules/system/src/Tests/Update/UpdatePathTestBase.php
Overrides WebTestBase::setUp() for update testing.

File

core/modules/system/src/Tests/Update/UpdatePathTestBase.php, line 210

Class

UpdatePathTestBase
Provides a base class for writing an update test.

Namespace

Drupal\system\Tests\Update

Code

protected function prepareSettings() {
    parent::prepareSettings();
    // Remember the profile which was used.
    $settings['settings']['install_profile'] = (object) [
        'value' => $this->installProfile,
        'required' => TRUE,
    ];
    // Generate a hash salt.
    $settings['settings']['hash_salt'] = (object) [
        'value' => Crypt::randomBytesBase64(55),
        'required' => TRUE,
    ];
    // Since the installer isn't run, add the database settings here too.
    $settings['databases']['default'] = (object) [
        'value' => Database::getConnectionInfo(),
        'required' => TRUE,
    ];
    $this->writeSettings($settings);
}

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