function CssOptimizerUnitTest::testTypeFilePreprocessingDisabled in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::testTypeFilePreprocessingDisabled()
Tests a file CSS asset with preprocessing disabled.
File
- core/
tests/ Drupal/ Tests/ Core/ Asset/ CssOptimizerUnitTest.php, line 235 - Contains \Drupal\Tests\Core\Asset\CssOptimizerUnitTest.
Class
- CssOptimizerUnitTest
- Tests the CSS asset optimizer.
Namespace
Drupal\Tests\Core\AssetCode
function testTypeFilePreprocessingDisabled() {
$this
->setExpectedException('Exception', 'Only file CSS assets with preprocessing enabled can be optimized.');
$css_asset = array(
'group' => -100,
'type' => 'file',
'weight' => 0.012,
'media' => 'all',
// Preprocessing disabled.
'preprocess' => FALSE,
'data' => 'tests/Drupal/Tests/Core/Asset/foo.css',
'browsers' => array(
'IE' => TRUE,
'!IE' => TRUE,
),
'basename' => 'foo.css',
);
$this->optimizer
->optimize($css_asset);
}