function LibraryDependencyResolverTest::setUp

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

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Asset/LibraryDependencyResolverTest.php, line 61

Class

LibraryDependencyResolverTest
@coversDefaultClass \Drupal\Core\Asset\LibraryDependencyResolver @group Asset

Namespace

Drupal\Tests\Core\Asset

Code

protected function setUp() : void {
    parent::setUp();
    $this->libraryDiscoveryParser = $this->getMockBuilder('Drupal\\Core\\Asset\\LibraryDiscoveryParser')
        ->disableOriginalConstructor()
        ->getMock();
    $this->libraryDiscovery = $this->getMockBuilder(LibraryDiscoveryCollector::class)
        ->disableOriginalConstructor()
        ->onlyMethods([
        'getLibrariesByExtension',
    ])
        ->getMock();
    $this->libraryDiscovery
        ->expects($this->any())
        ->method('getLibrariesByExtension')
        ->with('test')
        ->willReturn($this->libraryData);
    $this->libraryDependencyResolver = new LibraryDependencyResolver($this->libraryDiscovery);
}

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