function TestSiteInstallCommand::executeSetupClass

Same name in other branches
  1. 9 core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executeSetupClass()
  2. 8.9.x core/tests/Drupal/TestSite/Commands/TestSiteInstallCommand.php \Drupal\TestSite\Commands\TestSiteInstallCommand::executeSetupClass()
  3. 10 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 264

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

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