function AttachedAssetsTest::testDefault

Same name in other branches
  1. 8.9.x 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 64

Class

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

Namespace

Drupal\KernelTests\Core\Asset

Code

public function testDefault() {
    $assets = new AttachedAssets();
    $this->assertEquals([], $this->assetResolver
        ->getCssAssets($assets, FALSE), 'Default CSS is empty.');
    [
        $js_assets_header,
        $js_assets_footer,
    ] = $this->assetResolver
        ->getJsAssets($assets, FALSE);
    $this->assertEquals([], $js_assets_header, 'Default header JavaScript is empty.');
    $this->assertEquals([], $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.