You are here

protected function TestSiteInstallCommand::executeSetupClass in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executeSetupClass()

Uses the setup file to configure Drupal.

Parameters

string $class: The fully qualified class name, which should set up Drupal for tests. For example this class could create content types and fields or install modules. The class needs to implement TestSetupInterface.

See also

\Drupal\TestSite\TestSetupInterface

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

File

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

Class

TestSiteInstallCommand
Command to create a test Drupal site.

Namespace

Drupal\TestSite\Commands

Code

protected function executeSetupClass($class) {
  if (is_subclass_of($class, TestSetupInterface::class)) {

    /** @var \Drupal\TestSite\TestSetupInterface $instance */
    $instance = new $class();
    $instance
      ->setup();
  }
}