You are here

protected function TestSiteInstallCommand::executePreinstallClass in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executePreinstallClass()
  2. 9 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 233

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);
  }
}