function CssCollectionOptimizerUnitTest::testCssImport

Same name in other branches
  1. 10 core/tests/Drupal/Tests/Core/Asset/CssCollectionOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssCollectionOptimizerUnitTest::testCssImport()

Test that css imports with strange letters do not destroy the css output.

File

core/tests/Drupal/Tests/Core/Asset/CssCollectionOptimizerUnitTest.php, line 69

Class

CssCollectionOptimizerUnitTest
Tests the CSS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

public function testCssImport() {
    $this->optimizer
        ->optimize([
        'core/modules/system/tests/modules/common_test/common_test_css_import.css' => [
            'type' => 'file',
            'data' => 'core/modules/system/tests/modules/common_test/common_test_css_import.css',
            'preprocess' => TRUE,
        ],
        'core/modules/system/tests/modules/common_test/common_test_css_import_not_preprocessed.css' => [
            'type' => 'file',
            'data' => 'core/modules/system/tests/modules/common_test/common_test_css_import.css',
            'preprocess' => TRUE,
        ],
    ]);
    self::assertEquals(file_get_contents(__DIR__ . '/css_test_files/css_input_with_import.css.optimized.aggregated.css'), $this->dumperData);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.