You are here

protected function RegistryTest::setupTheme in Drupal 8

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

File

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

Class

RegistryTest
@coversDefaultClass \Drupal\Core\Theme\Registry @group Theme

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_test') {
      return 'core/modules/system/tests/modules/theme_test';
    }
  });
  $this->registry
    ->setThemeManager($this->themeManager);
}