class TestSiteOliveroInstallTestScript
Same name in this branch
- main core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
Same name and namespace in other branches
- 11.x core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
- 10 core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
- 9 core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php \Drupal\TestSite\TestSiteOliveroInstallTestScript
- 11.x core/modules/search/tests/src/Nightwatch/Tests/Olivero/TestSiteOliveroInstallTestScript.php \Drupal\Tests\search\Nightwatch\Olivero\TestSiteOliveroInstallTestScript
Setup file used by TestSiteInstallTestScript.
Hierarchy
- class \Drupal\Tests\search\Nightwatch\Olivero\TestSiteOliveroInstallTestScript implements \Drupal\TestSite\TestSetupInterface
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\OliveroView 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.