function RegistryLegacyTest::setupTheme

Same name and namespace in other branches
  1. 8.9.x 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 156

Class

RegistryLegacyTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Theme%21Registry.php/class/Registry/9" title="Defines the theme registry service." class="local">\Drupal\Core\Theme\Registry</a> @group Theme @group legacy

Namespace

Drupal\Tests\Core\Theme

Code

protected function setupTheme() {
    $this->registry = $this->getMockBuilder(Registry::class)
        ->onlyMethods([
        'getPath',
    ])
        ->setConstructorArgs([
        $this->root,
        $this->cache,
        $this->lock,
        $this->moduleHandler,
        $this->themeHandler,
        $this->themeInitialization,
        $this->runtimeCache,
        $this->moduleList,
    ])
        ->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);
}

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