function LibraryDiscoveryParserTest::setUp

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

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php, line 99

Class

LibraryDiscoveryParserTest
@coversDefaultClass \Drupal\Core\Asset\LibraryDiscoveryParser[[api-linebreak]] @group Asset

Namespace

Drupal\Tests\Core\Asset

Code

protected function setUp() : void {
  parent::setUp();
  $this->moduleHandler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->themeManager = $this->createMock(ThemeManagerInterface::class);
  $this->activeTheme = $this->getMockBuilder(ActiveTheme::class)
    ->disableOriginalConstructor()
    ->getMock();
  $this->activeTheme
    ->expects($this->any())
    ->method('getLibrariesOverride')
    ->willReturn([]);
  $this->themeManager
    ->expects($this->any())
    ->method('getActiveTheme')
    ->willReturn($this->activeTheme);
  $this->streamWrapperManager = $this->createMock(StreamWrapperManagerInterface::class);
  $this->librariesDirectoryFileFinder = $this->createMock(LibrariesDirectoryFileFinder::class);
  $this->extensionPathResolver = $this->createMock(ExtensionPathResolver::class);
  $this->componentPluginManager = $this->createMock(ComponentPluginManager::class);
  $this->libraryDiscoveryParser = new TestLibraryDiscoveryParser($this->root, $this->moduleHandler, $this->themeManager, $this->streamWrapperManager, $this->librariesDirectoryFileFinder, $this->extensionPathResolver, $this->componentPluginManager);
}

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