class TestSiteOliveroInstallTestScript

Same name in this branch
  1. main core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
Same name and namespace in other branches
  1. 11.x core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
  2. 10 core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
  3. 9 core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
  4. 11.x core/modules/search/tests/src/Nightwatch/Tests/Olivero/TestSiteOliveroInstallTestScript.php \Drupal\Tests\search\Nightwatch\Olivero\TestSiteOliveroInstallTestScript

Setup file used by TestSiteInstallTestScript.

Hierarchy

Expanded class hierarchy of TestSiteOliveroInstallTestScript

See also

\Drupal\KernelTests\Scripts\TestSiteApplicationTest

File

core/modules/search/tests/src/Nightwatch/Tests/Olivero/TestSiteOliveroInstallTestScript.php, line 16

Namespace

Drupal\Tests\search\Nightwatch\Olivero
View source
class TestSiteOliveroInstallTestScript implements TestSetupInterface {
  
  /**
   * {@inheritdoc}
   */
  public function setup() : void {
    // Install required module for the Olivero front page.
    $module_installer = \Drupal::service('module_installer');
    assert($module_installer instanceof ModuleInstallerInterface);
    $module_installer->install([
      'olivero_test',
    ]);
    $module_installer->install([
      'search',
    ]);
    // Install Olivero and set it as the default theme.
    $theme_installer = \Drupal::service('theme_installer');
    assert($theme_installer instanceof ThemeInstallerInterface);
    $theme_installer->install([
      'olivero',
    ], TRUE);
    $system_theme_config = \Drupal::configFactory()->getEditable('system.theme');
    $system_theme_config->set('default', 'olivero')
      ->save();
  }

}

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