Same name in other branches
  1. 5.0.x advagg_js_minify/tests/src/Kernel/Asset/JsMinifierUnitTest.php \Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest::testMinifyJshrink()
  2. 6.0.x advagg_js_minify/tests/src/Kernel/Asset/JsMinifierUnitTest.php \Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest::testMinifyJshrink()
  3. 8.x-4.x advagg_js_minify/tests/src/Kernel/Asset/JsMinifierUnitTest.php \Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest::testMinifyJshrink()

Tests minification of a JS Asset with JShrink.

@dataProvider providerTestMinification

Paramètres

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

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

Fichier

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

Classe

JsMinifierUnitTest
Tests the JS asset minifier.

Namespace

Drupal\Tests\advagg_js_minify\Kernel\Asset

Code

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