function AttachedAssetsTest::testDefault

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testDefault()
  2. 10 core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testDefault()
  3. 11.x core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php \Drupal\KernelTests\Core\Asset\AttachedAssetsTest::testDefault()

Tests that default CSS and JavaScript is empty.

File

core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php, line 57

Class

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

Namespace

Drupal\KernelTests\Core\Asset

Code

public function testDefault() {
    $assets = new AttachedAssets();
    $this->assertEqual([], $this->assetResolver
        ->getCssAssets($assets, FALSE), 'Default CSS is empty.');
    list($js_assets_header, $js_assets_footer) = $this->assetResolver
        ->getJsAssets($assets, FALSE);
    $this->assertEqual([], $js_assets_header, 'Default header JavaScript is empty.');
    $this->assertEqual([], $js_assets_footer, 'Default footer JavaScript is empty.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.