You are here

public function JsMinifierUnitTest::testMinifyJsminPlus in Advanced CSS/JS Aggregation 8.4

Same name and namespace in other branches
  1. 8.3 advagg_js_minify/tests/src/Kernel/Asset/JsMinifierUnitTest.php \Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest::testMinifyJsminPlus()

Tests minification of a JS Asset with JSMinplus.

@dataProvider providerTestMinification

Parameters

array $js_asset: An fake asset array with the filepath to pass to the minifier.

string $contents: The asset string contents to be minified.

File

advagg_js_minify/tests/src/Kernel/Asset/JsMinifierUnitTest.php, line 161

Class

JsMinifierUnitTest
Tests the JS asset minifier.

Namespace

Drupal\Tests\advagg_js_minify\Kernel\Asset

Code

public function testMinifyJsminPlus(array $js_asset, $contents) {
  $this
    ->config('advagg_js_minify.settings')
    ->set('minifier', 1)
    ->save();
  $expected = file_get_contents($js_asset['data'] . '.jsminplus.js');
  $this
    ->assertEquals($expected, $this->optimizer
    ->optimize($contents, $js_asset, []));
}