function AssetResolverTest::testGetJsAssets

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

@covers ::getJsAssets @dataProvider providerAttachedAssets

File

core/tests/Drupal/Tests/Core/Asset/AssetResolverTest.php, line 134

Class

AssetResolverTest
@coversDefaultClass \Drupal\Core\Asset\AssetResolver @group Asset

Namespace

Drupal\Tests\Core\Asset

Code

public function testGetJsAssets(AttachedAssetsInterface $assets_a, AttachedAssetsInterface $assets_b, $expected_cache_item_count) {
    $this->assetResolver
        ->getJsAssets($assets_a, FALSE);
    $this->assetResolver
        ->getJsAssets($assets_b, FALSE);
    $this->assertCount($expected_cache_item_count, $this->cache
        ->getAllCids());
    $this->assetResolver
        ->getJsAssets($assets_a, FALSE);
    $this->assetResolver
        ->getJsAssets($assets_b, FALSE);
    $this->assertCount($expected_cache_item_count * 2, $this->cache
        ->getAllCids());
}

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