You are here

function AttachedAssetsTest::testLibraryNameConflicts in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Common/AttachedAssetsTest.php \Drupal\system\Tests\Common\AttachedAssetsTest::testLibraryNameConflicts()

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

See also

common_test.library.yml

File

core/modules/system/src/Tests/Common/AttachedAssetsTest.php, line 455
Contains \Drupal\system\Tests\Common\AttachedAssetsTest.

Class

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

Namespace

Drupal\system\Tests\Common

Code

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.');
}