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::providerTestClean()
  2. 6.0.x advagg_js_minify/tests/src/Kernel/Asset/JsMinifierUnitTest.php \Drupal\Tests\advagg_js_minify\Kernel\Asset\JsMinifierUnitTest::providerTestClean()
  3. 8.x-4.x 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.

Voir aussi

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

Fichier

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

Classe

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'),
        ],
    ];
}