function JsOptimizerUnitTest::providerTestClean

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php \Drupal\Tests\Core\Asset\JsOptimizerUnitTest::providerTestClean()
  2. 8.9.x core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php \Drupal\Tests\Core\Asset\JsOptimizerUnitTest::providerTestClean()
  3. 10 core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php \Drupal\Tests\Core\Asset\JsOptimizerUnitTest::providerTestClean()

Provides data for the JS asset cleaning test.

Return value

array An array of test data.

See also

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

File

core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php, line 41

Class

JsOptimizerUnitTest
Tests the JS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.