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. 10 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 76

Class

LibraryDiscoveryParserTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Asset%21LibraryDiscoveryParser.php/class/LibraryDiscoveryParser/8.9.x" title="Parses library files to get extension data." class="local">\Drupal\Core\Asset\LibraryDiscoveryParser</a> @group Asset

Namespace

Drupal\Tests\Core\Asset

Code

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

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