function AttachedAssetsTest::testLibraryUnknown
Same name in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryUnknown()
- 10 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryUnknown()
- 11.x core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testLibraryUnknown()
Tests non-existing libraries.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Asset/ AttachedAssetsTest.php, line 75
Class
- AttachedAssetsTest
- Tests #attached assets: attached asset libraries and JavaScript settings.
Namespace
Drupal\KernelTests\Core\AssetCode
public function testLibraryUnknown() {
$build['#attached']['library'][] = 'core/unknown';
$assets = AttachedAssets::createFromRenderArray($build);
$this->assertSame([], $this->assetResolver
->getJsAssets($assets, FALSE)[0], 'Unknown library was not added to the page.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.