function CssCollectionOptimizerLazyUnitTest::testLocalMinifiedCssAssetOptimizationIsNotSkipped

Test that local minified CSS assets still trigger optimization.

This ensures that local minified assets are optimized to correct relative paths.

File

core/tests/Drupal/Tests/Core/Asset/CssCollectionOptimizerLazyUnitTest.php, line 223

Class

CssCollectionOptimizerLazyUnitTest
Tests the CSS asset optimizer.

Namespace

Drupal\Tests\Core\Asset

Code

public function testLocalMinifiedCssAssetOptimizationIsNotSkipped() : void {
  $mock_grouper = $this->createMock(AssetCollectionGrouperInterface::class);
  $mock_optimizer = $this->createMock(AssetOptimizerInterface::class);
  $mock_optimizer->expects($this->once())
    ->method('optimize');
  $optimizer = new CssCollectionOptimizerLazy($mock_grouper, $mock_optimizer, $this->createMock(ThemeManagerInterface::class), $this->createMock(LibraryDependencyResolverInterface::class), new RequestStack(), $this->createMock(FileSystemInterface::class), $this->createMock(ConfigFactoryInterface::class), $this->createMock(FileUrlGeneratorInterface::class), $this->createMock(TimeInterface::class), $this->createMock(LanguageManagerInterface::class));
  $optimizer->optimizeGroup([
    'items' => [
      [
        'type' => 'file',
        'data' => 'core/tests/Drupal/Tests/Core/Asset/css_test_files/css_input_with_import.css',
        'license' => FALSE,
        'preprocess' => TRUE,
        'minified' => TRUE,
      ],
    ],
  ]);
}

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