Skip to content

Commit e7c7b39

Browse files
committed
Merge branch '4.4' into 5.4
* 4.4: skip a test if the mime type detection feature will not work minor #47751 Norgweiang translations (ibonkonesa) fix overflow issue in WebPprofiler Forms panel
2 parents 0cf0ec2 + 7eea76a commit e7c7b39

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Tests/BinaryFileResponseTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1515
use Symfony\Component\HttpFoundation\BinaryFileResponse;
16+
use Symfony\Component\HttpFoundation\File\File;
1617
use Symfony\Component\HttpFoundation\File\Stream;
1718
use Symfony\Component\HttpFoundation\Request;
1819
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
@@ -413,7 +414,15 @@ public function testPrepareNotAddingContentTypeHeaderIfNoContentResponse()
413414

414415
public function testContentTypeIsCorrectlyDetected()
415416
{
416-
$response = new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif');
417+
$file = new File(__DIR__.'/File/Fixtures/test.gif');
418+
419+
try {
420+
$file->getMimeType();
421+
} catch (\LogicException $e) {
422+
$this->markTestSkipped('Guessing the mime type is not possible');
423+
}
424+
425+
$response = new BinaryFileResponse($file);
417426

418427
$request = Request::create('/');
419428
$response->prepare($request);

0 commit comments

Comments
 (0)