function RegistryTest::setUp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Theme/RegistryTest.php \Drupal\Tests\Core\Theme\RegistryTest::setUp()
  2. 8.9.x core/tests/Drupal/Tests/Core/Theme/RegistryTest.php \Drupal\Tests\Core\Theme\RegistryTest::setUp()
  3. 11.x core/tests/Drupal/Tests/Core/Theme/RegistryTest.php \Drupal\Tests\Core\Theme\RegistryTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Theme/RegistryTest.php, line 99

Class

RegistryTest
@coversDefaultClass \Drupal\Core\Theme\Registry[[api-linebreak]] @group Theme

Namespace

Drupal\Tests\Core\Theme

Code

protected function setUp() : void {
  parent::setUp();
  $this->cache = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->lock = $this->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
  $this->moduleHandler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->themeHandler = $this->createMock('Drupal\\Core\\Extension\\ThemeHandlerInterface');
  $this->themeInitialization = $this->createMock('Drupal\\Core\\Theme\\ThemeInitializationInterface');
  $this->runtimeCache = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->themeManager = $this->createMock('Drupal\\Core\\Theme\\ThemeManagerInterface');
  $this->moduleList = $this->createMock(ModuleExtensionList::class);
  $this->kernel = $this->createMock(HttpKernelInterface::class);
  $this->registry = new Registry($this->root, $this->cache, $this->lock, $this->moduleHandler, $this->themeHandler, $this->themeInitialization, $this->runtimeCache, $this->moduleList, $this->kernel);
  $this->registry
    ->setThemeManager($this->themeManager);
}

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