function AttachedAssetsTest::testLibraryUnknown
Tests non-existing libraries.
File
- 
              core/
tests/ Drupal/ KernelTests/ Core/ Asset/ AttachedAssetsTest.php, line 77  
Class
- AttachedAssetsTest
 - Tests #attached assets: attached asset libraries and JavaScript settings.
 
Namespace
Drupal\KernelTests\Core\AssetCode
public function testLibraryUnknown() : void {
  $build['#attached']['library'][] = 'core/unknown';
  $assets = AttachedAssets::createFromRenderArray($build);
  $this->assertSame([], $this->assetResolver
    ->getJsAssets($assets, FALSE, \Drupal::languageManager()->getCurrentLanguage())[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.