function CssOptimizerUnitTest::testTypeFilePreprocessingDisabled
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::testTypeFilePreprocessingDisabled()
- 10 core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::testTypeFilePreprocessingDisabled()
- 11.x 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 249
Class
- CssOptimizerUnitTest
- Tests the CSS asset optimizer.
Namespace
Drupal\Tests\Core\AssetCode
public function testTypeFilePreprocessingDisabled() {
$this->expectException('Exception');
$this->expectExceptionMessage('Only file CSS assets with preprocessing enabled can be optimized.');
$css_asset = [
'group' => -100,
'type' => 'file',
'weight' => 0.012,
'media' => 'all',
// Preprocessing disabled.
'preprocess' => FALSE,
'data' => 'tests/Drupal/Tests/Core/Asset/foo.css',
'browsers' => [
'IE' => TRUE,
'!IE' => TRUE,
],
'basename' => 'foo.css',
];
$this->optimizer
->optimize($css_asset);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.