File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/Symfony/Component/AssetMapper Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public function getDestinationPath(): string
5050 return $ this ->publicDir ;
5151 }
5252
53- private function compress ($ targetPath ): void
53+ private function compress (string $ targetPath ): void
5454 {
5555 foreach ($ this ->extensionsToCompress as $ ext ) {
5656 if (!str_ends_with ($ targetPath , ". $ ext " )) {
Original file line number Diff line number Diff line change 1414use PHPUnit \Framework \TestCase ;
1515use Symfony \Component \AssetMapper \Compressor \BrotliCompressor ;
1616use Symfony \Component \AssetMapper \Compressor \ChainCompressor ;
17+ use Symfony \Component \AssetMapper \Compressor \GzipCompressor ;
1718use Symfony \Component \AssetMapper \Compressor \ZstandardCompressor ;
1819use Symfony \Component \Filesystem \Filesystem ;
1920
@@ -41,14 +42,21 @@ protected function tearDown(): void
4142
4243 public function testCompress ()
4344 {
44- $ extensions = ['gz ' ];
45+ $ extensions = [];
46+ if (null === (new GzipCompressor ())->getUnsupportedReason ()) {
47+ $ extensions [] = 'gz ' ;
48+ }
4549 if (null === (new BrotliCompressor ())->getUnsupportedReason ()) {
4650 $ extensions [] = 'br ' ;
4751 }
4852 if (null === (new ZstandardCompressor ())->getUnsupportedReason ()) {
4953 $ extensions [] = 'zst ' ;
5054 }
5155
56+ if (!$ extensions ) {
57+ $ this ->markTestSkipped ('No supported compressors available. ' );
58+ }
59+
5260 $ this ->filesystem ->dumpFile (self ::WRITABLE_ROOT .'/foo/bar.js ' , 'foobar ' );
5361
5462 (new ChainCompressor ())->compress (self ::WRITABLE_ROOT .'/foo/bar.js ' );
You can’t perform that action at this time.
0 commit comments