function CascadingStylesheetsTestCase::testRenderRemoveCharsetPreprocess
Tests removing charset when rendering stylesheets with preprocessing on.
File
-
modules/
simpletest/ tests/ common.test, line 857
Class
- CascadingStylesheetsTestCase
- Test the Drupal CSS system.
Code
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.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.