function TestSiteInstallCommand::executePreinstallClass

Same name in other branches
  1. 9 core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executePreinstallClass()
  2. 8.9.x core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executePreinstallClass()
  3. 11.x core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executePreinstallClass()

Uses the setup file to configure the environment prior to install.

Parameters

string $class: The fully qualified class name, which should set up the environment prior to installing Drupal for tests. For example this class could create translations that are used during the installer.

See also

\Drupal\TestSite\TestPreinstallInterface

1 call to TestSiteInstallCommand::executePreinstallClass()
TestSiteInstallCommand::setup in core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php
Creates a test drupal installation.

File

core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php, line 282

Class

TestSiteInstallCommand
Command to create a test Drupal site.

Namespace

Drupal\TestSite\Commands

Code

protected function executePreinstallClass($class) {
    if (is_subclass_of($class, TestPreinstallInterface::class)) {
        
        /** @var \Drupal\TestSite\TestPreinstallInterface $instance */
        $instance = new $class();
        $instance->preinstall($this->databasePrefix, $this->siteDirectory);
    }
}

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