You are here

protected function RegistryLegacyTest::setupTheme in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Theme/RegistryLegacyTest.php \Drupal\Tests\Core\Theme\RegistryLegacyTest::setupTheme()
1 call to RegistryLegacyTest::setupTheme()
RegistryLegacyTest::setUp in core/tests/Drupal/Tests/Core/Theme/RegistryLegacyTest.php

File

core/tests/Drupal/Tests/Core/Theme/RegistryLegacyTest.php, line 134

Class

RegistryLegacyTest
@coversDefaultClass \Drupal\Core\Theme\Registry @group Theme @group legacy

Namespace

Drupal\Tests\Core\Theme

Code

protected function setupTheme() {
  $this->registry = $this
    ->getMockBuilder(Registry::class)
    ->setMethods([
    'getPath',
  ])
    ->setConstructorArgs([
    $this->root,
    $this->cache,
    $this->lock,
    $this->moduleHandler,
    $this->themeHandler,
    $this->themeInitialization,
  ])
    ->getMock();
  $this->registry
    ->expects($this
    ->any())
    ->method('getPath')
    ->willReturnCallback(function ($module) {
    if ($module == 'theme_legacy_test') {
      return 'core/modules/system/tests/modules/theme_legacy_test';
    }
  });
  $this->registry
    ->setThemeManager($this->themeManager);
}