You are here

public function AttachedAssetsTest::testDefault in Drupal 9

Same name and namespace in other branches
  1. 8 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.');
  list($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.');
}