diff --git a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php index 439d888..60384f0 100644 --- a/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php @@ -201,6 +201,23 @@ function testOptimize($css_asset, $expected) { } /** + * Tests optimizing a CSS asset containing charset declaration. + */ + function testOptimizeRemoveCharset() { + $css_asset = array( + 'type' => 'inline', + 'data' => '@charset "UTF-8";html{font-family:"sans-serif";}', + 'preprocess' => FALSE, + ); + $expected = 'html{font-family:"sans-serif";}'; + $this->assertEquals( + $expected, + $this->optimizer->optimize($css_asset), + 'CSS optimizing correctly removes the charset declaration.' + ); + } + + /** * Tests a file CSS asset with preprocessing disabled. */ function testTypeFilePreprocessingDisabled() {