You are here

public function LibraryDiscoveryTest::testGetLibrariesByExtension in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php \Drupal\Tests\Core\Asset\LibraryDiscoveryTest::testGetLibrariesByExtension()
  2. 10 core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php \Drupal\Tests\Core\Asset\LibraryDiscoveryTest::testGetLibrariesByExtension()

@covers ::getLibrariesByExtension

File

core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryTest.php, line 82

Class

LibraryDiscoveryTest
@coversDefaultClass \Drupal\Core\Asset\LibraryDiscovery @group Asset

Namespace

Drupal\Tests\Core\Asset

Code

public function testGetLibrariesByExtension() {
  $this->libraryDiscovery
    ->getLibrariesbyExtension('test');

  // Verify that subsequent calls don't trigger hook_library_info_alter()
  // and hook_js_settings_alter() invocations, nor do they talk to the
  // collector again. This ensures that the alterations made by
  // hook_library_info_alter() and hook_js_settings_alter() implementations
  // are statically cached, as desired.
  $this->libraryDiscovery
    ->getLibraryByName('test', 'test_1');
  $this->libraryDiscovery
    ->getLibrariesbyExtension('test');
}