You are here

public function JsMinifierUnitTest::providerTestClean 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::providerTestClean()

Provides data for the JS asset cleaning test.

@returns array An array of test data.

See also

\Drupal\Core\Asset\JsOptimizer::clean()

File

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

Class

JsMinifierUnitTest
Tests the JS asset minifier.

Namespace

Drupal\Tests\advagg_js_minify\Kernel\Asset

Code

public function providerTestClean() {
  $dir = dirname(__FILE__) . '/js_test_files/';
  return [
    // File. Tests:
    // - Stripped sourceMappingURL with comment # syntax.
    0 => [
      file_get_contents($dir . 'source_mapping_url.min.js'),
      file_get_contents($dir . 'source_mapping_url.min.js.optimized.js'),
    ],
    // File. Tests:
    // - Stripped sourceMappingURL with comment @ syntax.
    1 => [
      file_get_contents($dir . 'source_mapping_url_old.min.js'),
      file_get_contents($dir . 'source_mapping_url_old.min.js.optimized.js'),
    ],
    // File. Tests:
    // - Stripped sourceURL with comment # syntax.
    2 => [
      file_get_contents($dir . 'source_url.min.js'),
      file_get_contents($dir . 'source_url.min.js.optimized.js'),
    ],
    // File. Tests:
    // - Stripped sourceURL with comment @ syntax.
    3 => [
      file_get_contents($dir . 'source_url_old.min.js'),
      file_get_contents($dir . 'source_url_old.min.js.optimized.js'),
    ],
  ];
}