public function JsMinifierUnitTest::testMinifyJshrink in Advanced CSS/JS Aggregation 8.3
Same name and namespace in other branches
- 8.4 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
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 199
Class
- JsMinifierUnitTest
- Tests the JS asset minifier.
Namespace
Drupal\Tests\advagg_js_minify\Kernel\AssetCode
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, []));
}