function CssOptimizerUnitTest::testOptimize

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::testOptimize()
  2. 8.9.x core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::testOptimize()
  3. 10 core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php \Drupal\Tests\Core\Asset\CssOptimizerUnitTest::testOptimize()

Tests optimizing a CSS asset group containing 'type' => 'file'.

@dataProvider providerTestOptimize

File

core/tests/Drupal/Tests/Core/Asset/CssOptimizerUnitTest.php, line 242

Class

CssOptimizerUnitTest
Tests the CSS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

public function testOptimize($css_asset, $expected) : void {
    global $base_path;
    $original_base_path = $base_path;
    $base_path = '/';
    $this->assertEquals($expected, $this->optimizer
        ->optimize($css_asset), 'Group of file CSS assets optimized correctly.');
    $base_path = $original_base_path;
}

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