function 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.