You are here

function JsOptimizerUnitTest::providerTestClean in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php \Drupal\Tests\Core\Asset\JsOptimizerUnitTest::providerTestClean()

Provides data for the JS asset cleaning test.

@returns array An array of test data.

See also

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

File

core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php, line 44
Contains \Drupal\Tests\Core\Asset\JsOptimizerUnitTest.

Class

JsOptimizerUnitTest
Tests the JS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

function providerTestClean() {
  $path = dirname(__FILE__) . '/js_test_files/';
  return array(
    // File. Tests:
    // - Stripped sourceMappingURL with comment # syntax.
    0 => array(
      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 => array(
      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 => array(
      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 => array(
      file_get_contents($path . 'source_url_old.min.js'),
      file_get_contents($path . 'source_url_old.min.js.optimized.js'),
    ),
  );
}