function JsOptimizerUnitTest::testOptimize

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

Tests cleaning of a JS asset group containing 'type' => 'file'.

@dataProvider providerTestOptimize

File

core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php, line 142

Class

JsOptimizerUnitTest
Tests the JS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

public function testOptimize($js_asset, $expected) : void {
    $this->assertEquals($expected, $this->optimizer
        ->optimize($js_asset));
}

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