function ComponentKernelTestBase::setUp
Same name in this branch
- 11.x core/tests/Drupal/Tests/Core/Theme/Component/ComponentKernelTestBase.php \Drupal\Tests\Core\Theme\Component\ComponentKernelTestBase::setUp()
- 11.x core/tests/Drupal/KernelTests/Components/ComponentKernelTestBase.php \Drupal\KernelTests\Components\ComponentKernelTestBase::setUp()
Same name in other branches
- 10 core/modules/sdc/tests/src/Kernel/ComponentKernelTestBase.php \Drupal\Tests\sdc\Kernel\ComponentKernelTestBase::setUp()
- 10 core/tests/Drupal/Tests/Core/Theme/Component/ComponentKernelTestBase.php \Drupal\Tests\Core\Theme\Component\ComponentKernelTestBase::setUp()
Overrides KernelTestBase::setUp
File
-
core/
modules/ sdc/ tests/ src/ Kernel/ ComponentKernelTestBase.php, line 55
Class
- ComponentKernelTestBase
- Defines a base class for component kernel tests.
Namespace
Drupal\Tests\sdc\KernelCode
protected function setUp() : void {
parent::setUp();
if (empty(static::$themes)) {
throw new \Exception('You need to set the protected static $themes property on your test class, with the first item being the default theme.');
}
$this->container
->get('theme_installer')
->install(static::$themes);
$this->installConfig('system');
$system_theme_config = $this->container
->get('config.factory')
->getEditable('system.theme');
$system_theme_config->set('default', reset(static::$themes))
->save();
$this->negotiator = new ComponentNegotiator(\Drupal::service('theme.manager'), \Drupal::service('extension.list.module'));
$this->manager = \Drupal::service('plugin.manager.sdc');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.