function AttachedAssetsTest::testLibraryNameConflicts
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryNameConflicts()
- 8.9.x core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryNameConflicts()
- 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 441
Class
- AttachedAssetsTest
- Tests #attached assets: attached asset libraries and JavaScript settings.
Namespace
Drupal\KernelTests\Core\AssetCode
public function testLibraryNameConflicts() : void {
/** @var \Drupal\Core\Asset\LibraryDiscoveryInterface $library_discovery */
$library_discovery = \Drupal::service('library.discovery');
$loadjs = $library_discovery->getLibraryByName('common_test', 'loadjs');
$this->assertEquals('0.1', $loadjs['version'], 'Alternative libraries can be added to the page.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.