You are here

function JsOptimizerUnitTest::providerTestOptimize 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::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 91
Contains \Drupal\Tests\Core\Asset\JsOptimizerUnitTest.

Class

JsOptimizerUnitTest
Tests the JS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

function providerTestOptimize() {
  $path = dirname(__FILE__) . '/js_test_files/';
  return array(
    0 => array(
      array(
        'type' => 'file',
        'preprocess' => TRUE,
        'data' => $path . 'utf8_bom.js',
      ),
      file_get_contents($path . 'utf8_bom.js.optimized.js'),
    ),
    1 => array(
      array(
        'type' => 'file',
        'preprocess' => TRUE,
        'data' => $path . 'utf16_bom.js',
      ),
      file_get_contents($path . 'utf16_bom.js.optimized.js'),
    ),
    2 => array(
      array(
        'type' => 'file',
        'preprocess' => TRUE,
        'data' => $path . 'latin_9.js',
        'attributes' => array(
          'charset' => 'ISO-8859-15',
        ),
      ),
      file_get_contents($path . 'latin_9.js.optimized.js'),
    ),
  );
}