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
50
50
return $ this ->publicDir ;
51
51
}
52
52
53
- private function compress ($ targetPath ): void
53
+ private function compress (string $ targetPath ): void
54
54
{
55
55
foreach ($ this ->extensionsToCompress as $ ext ) {
56
56
if (!str_ends_with ($ targetPath , ". $ ext " )) {
Original file line number Diff line number Diff line change 14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \AssetMapper \Compressor \BrotliCompressor ;
16
16
use Symfony \Component \AssetMapper \Compressor \ChainCompressor ;
17
+ use Symfony \Component \AssetMapper \Compressor \GzipCompressor ;
17
18
use Symfony \Component \AssetMapper \Compressor \ZstandardCompressor ;
18
19
use Symfony \Component \Filesystem \Filesystem ;
19
20
@@ -41,14 +42,21 @@ protected function tearDown(): void
41
42
42
43
public function testCompress ()
43
44
{
44
- $ extensions = ['gz ' ];
45
+ $ extensions = [];
46
+ if (null === (new GzipCompressor ())->getUnsupportedReason ()) {
47
+ $ extensions [] = 'gz ' ;
48
+ }
45
49
if (null === (new BrotliCompressor ())->getUnsupportedReason ()) {
46
50
$ extensions [] = 'br ' ;
47
51
}
48
52
if (null === (new ZstandardCompressor ())->getUnsupportedReason ()) {
49
53
$ extensions [] = 'zst ' ;
50
54
}
51
55
56
+ if (!$ extensions ) {
57
+ $ this ->markTestSkipped ('No supported compressors available. ' );
58
+ }
59
+
52
60
$ this ->filesystem ->dumpFile (self ::WRITABLE_ROOT .'/foo/bar.js ' , 'foobar ' );
53
61
54
62
(new ChainCompressor ())->compress (self ::WRITABLE_ROOT .'/foo/bar.js ' );
You can’t perform that action at this time.
0 commit comments