You are here

public function AttachedAssetsTest::testLibraryNameConflicts in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryNameConflicts()
  2. 10 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryNameConflicts()

Tests that multiple modules can implement libraries with the same name.

See also

common_test.library.yml

File

core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php, line 449

Class

AttachedAssetsTest
Tests #attached assets: attached asset libraries and JavaScript settings.

Namespace

Drupal\KernelTests\Core\Asset

Code

public function testLibraryNameConflicts() {

  /** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
  $library_discovery = \Drupal::service('library.discovery');
  $farbtastic = $library_discovery
    ->getLibraryByName('common_test', 'jquery.farbtastic');
  $this
    ->assertEqual($farbtastic['version'], '0.1', 'Alternative libraries can be added to the page.');
}