You are here

function AttachedAssetsTest::testLibraryUnknown 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::testLibraryUnknown()

Tests non-existing libraries.

File

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

Class

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

Namespace

Drupal\system\Tests\Common

Code

function testLibraryUnknown() {
  $build['#attached']['library'][] = 'core/unknown';
  $assets = AttachedAssets::createFromRenderArray($build);
  $this
    ->assertIdentical([], $this->assetResolver
    ->getJsAssets($assets, FALSE)[0], 'Unknown library was not added to the page.');
}