function ThemeHandlerTest::setUp

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

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php, line 43

Class

ThemeHandlerTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Extension%21ThemeHandler.php/class/ThemeHandler/11.x" title="Default theme handler using the config system to store installation statuses." class="local">\Drupal\Core\Extension\ThemeHandler</a> @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

protected function setUp() : void {
    parent::setUp();
    $this->configFactory = $this->getConfigFactoryStub([
        'core.extension' => [
            'module' => [],
            'theme' => [],
            'disabled' => [
                'theme' => [],
            ],
        ],
    ]);
    $this->themeList = $this->getMockBuilder(ThemeExtensionList::class)
        ->disableOriginalConstructor()
        ->getMock();
    $this->themeHandler = new StubThemeHandler($this->root, $this->configFactory, $this->themeList);
    $container = $this->createMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
    $container->expects($this->any())
        ->method('get')
        ->with('class_loader')
        ->willReturn($this->createMock(ClassLoader::class));
    \Drupal::setContainer($container);
}

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