You are here

public function CssCollectionRendererUnitTest::testRenderInvalidType in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php \Drupal\Tests\Core\Asset\CssCollectionRendererUnitTest::testRenderInvalidType()

Tests a CSS asset group with the invalid 'type' => 'internal'.

File

core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php, line 281

Class

CssCollectionRendererUnitTest
Tests the CSS asset collection renderer.

Namespace

Drupal\Tests\Core\Asset

Code

public function testRenderInvalidType() {
  $this
    ->expectException('Exception');
  $this
    ->expectExceptionMessage('Invalid CSS asset type.');
  $css_group = [
    'group' => 0,
    'type' => 'internal',
    'media' => 'all',
    'preprocess' => TRUE,
    'browsers' => [],
    'data' => 'http://example.com/popular.js',
  ];
  $this->renderer
    ->render([
    $css_group,
  ]);
}