function ThemeHandlerTest::setUp

Same name 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 \Drupal\Core\Extension\ThemeHandler @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.