function JsOptimizerUnitTest::providerTestOptimize
Provides data for the JS asset optimize test.
@returns array An array of test data.
See also
\Drupal\Core\Asset\JsOptimizer::optimize()
File
- 
              core/tests/ Drupal/ Tests/ Core/ Asset/ JsOptimizerUnitTest.php, line 86 
Class
- JsOptimizerUnitTest
- Tests the JS asset optimizer.
Namespace
Drupal\Tests\Core\AssetCode
public function providerTestOptimize() {
  $path = dirname(__FILE__) . '/js_test_files/';
  return [
    0 => [
      [
        'type' => 'file',
        'preprocess' => TRUE,
        'data' => $path . 'utf8_bom.js',
      ],
      file_get_contents($path . 'utf8_bom.js.optimized.js'),
    ],
    1 => [
      [
        'type' => 'file',
        'preprocess' => TRUE,
        'data' => $path . 'utf16_bom.js',
      ],
      file_get_contents($path . 'utf16_bom.js.optimized.js'),
    ],
    2 => [
      [
        'type' => 'file',
        'preprocess' => TRUE,
        'data' => $path . 'latin_9.js',
        'attributes' => [
          'charset' => 'ISO-8859-15',
        ],
      ],
      file_get_contents($path . 'latin_9.js.optimized.js'),
    ],
  ];
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
