From 94a26aac1c7e280d4fa5953f6c0622b07bbff3bc Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Wed, 25 Dec 2013 16:56:54 -0500 Subject: Issue #2040209 by WebEvt: CSS is truncated when aggregation is turned on. --- modules/simpletest/tests/common.test | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'modules/simpletest') diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 8694ff32e..856945f63 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -686,6 +686,31 @@ class CascadingStylesheetsTestCase extends DrupalWebTestCase { $this->assertEqual(trim($styles), $css_preprocessed, 'Rendering preprocessed inline CSS adds it to the page.'); } + /** + * Tests removing charset when rendering stylesheets with preprocessing on. + */ + function testRenderRemoveCharsetPreprocess() { + $cases = array( + array( + 'asset' => '@charset "UTF-8";html{font-family:"sans-serif";}', + 'expected' => 'html{font-family:"sans-serif";}', + ), + // This asset contains extra \n character. + array( + 'asset' => "@charset 'UTF-8';\nhtml{font-family:'sans-serif';}", + 'expected' => "\nhtml{font-family:'sans-serif';}", + ), + ); + + foreach ($cases as $case) { + $this->assertEqual( + $case['expected'], + drupal_load_stylesheet_content($case['asset']), + 'CSS optimizing correctly removes the charset declaration.' + ); + } + } + /** * Tests rendering inline stylesheets with preprocessing off. */ -- cgit v1.2.3