function FunctionalTestSetupTrait::installParameters

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::installParameters()
  2. 10 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::installParameters()
  3. 11.x core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::installParameters()

Returns the parameters that will be used when Simpletest installs Drupal.

Return value

array Array of parameters for use in install_drupal().

See also

install_drupal()

install_state_defaults()

10 calls to FunctionalTestSetupTrait::installParameters()
DemoUmamiProfileTest::installParameters in core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
Returns the parameters that will be used when Simpletest installs Drupal.
FunctionalTestSetupTrait::doInstall in core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
Execute the non-interactive installer.
HelpTopicTranslatedTestBase::installParameters in core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerTestBase::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerTranslationMultipleLanguageNonInteractiveTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
Returns the parameters that will be used when Simpletest installs Drupal.

... See full list

8 methods override FunctionalTestSetupTrait::installParameters()
DemoUmamiProfileTest::installParameters in core/profiles/demo_umami/tests/src/Functional/DemoUmamiProfileTest.php
Returns the parameters that will be used when Simpletest installs Drupal.
HelpTopicTranslatedTestBase::installParameters in core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerTestBase::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTestBase.php
Returns the parameters that will be used when Simpletest installs Drupal.
InstallerTranslationMultipleLanguageNonInteractiveTest::installParameters in core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageNonInteractiveTest.php
Returns the parameters that will be used when Simpletest installs Drupal.
LocaleNonInteractiveInstallTest::installParameters in core/modules/locale/tests/src/Functional/LocaleNonInteractiveInstallTest.php
Returns the parameters that will be used when Simpletest installs Drupal.

... See full list

File

core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php, line 514

Class

FunctionalTestSetupTrait
Defines a trait for shared functional test setup functionality.

Namespace

Drupal\Core\Test

Code

protected function installParameters() {
    $connection_info = Database::getConnectionInfo();
    $driver = $connection_info['default']['driver'];
    unset($connection_info['default']['driver']);
    unset($connection_info['default']['namespace']);
    unset($connection_info['default']['autoload']);
    unset($connection_info['default']['pdo']);
    unset($connection_info['default']['init_commands']);
    // Remove database connection info that is not used by SQLite.
    if ($driver === 'sqlite') {
        unset($connection_info['default']['username']);
        unset($connection_info['default']['password']);
        unset($connection_info['default']['host']);
        unset($connection_info['default']['port']);
    }
    $parameters = [
        'interactive' => FALSE,
        'parameters' => [
            'profile' => $this->profile,
            'langcode' => 'en',
        ],
        'forms' => [
            'install_settings_form' => [
                'driver' => $driver,
                $driver => $connection_info['default'],
            ],
            'install_configure_form' => [
                'site_name' => 'Drupal',
                'site_mail' => 'simpletest@example.com',
                'account' => [
                    'name' => $this->rootUser->name,
                    'mail' => $this->rootUser
                        ->getEmail(),
                    'pass' => [
                        'pass1' => $this->rootUser->pass_raw ?? $this->rootUser->passRaw,
                        'pass2' => $this->rootUser->pass_raw ?? $this->rootUser->passRaw,
                    ],
                ],
                // \Drupal\Core\Render\Element\Checkboxes::valueCallback() requires
                // NULL instead of FALSE values for programmatic form submissions to
                // disable a checkbox.
'enable_update_status_module' => NULL,
                'enable_update_status_emails' => NULL,
            ],
        ],
    ];
    // If we only have one db driver available, we cannot set the driver.
    include_once DRUPAL_ROOT . '/core/includes/install.inc';
    if (count($this->getDatabaseTypes()) == 1) {
        unset($parameters['forms']['install_settings_form']['driver']);
    }
    return $parameters;
}

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