public function JsOptimizerUnitTest::providerTestClean in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Asset/JsOptimizerUnitTest.php \Drupal\Tests\Core\Asset\JsOptimizerUnitTest::providerTestClean()
- 10 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 39
Class
- JsOptimizerUnitTest
- Tests the JS asset optimizer.
Namespace
Drupal\Tests\Core\AssetCode
public 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'),
],
];
}