Skip to content

Commit e8aa505

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: sync message serializer code for forward-compatibility 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 247d63b + e7c7b39 commit e8aa505

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
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\HttpFoundation\Tests;
1313

1414
use Symfony\Component\HttpFoundation\BinaryFileResponse;
15+
use Symfony\Component\HttpFoundation\File\File;
1516
use Symfony\Component\HttpFoundation\File\Stream;
1617
use Symfony\Component\HttpFoundation\Request;
1718
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
@@ -390,7 +391,15 @@ public function testPrepareNotAddingContentTypeHeaderIfNoContentResponse()
390391

391392
public function testContentTypeIsCorrectlyDetected()
392393
{
393-
$response = new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif');
394+
$file = new File(__DIR__.'/File/Fixtures/test.gif');
395+
396+
try {
397+
$file->getMimeType();
398+
} catch (\LogicException $e) {
399+
$this->markTestSkipped('Guessing the mime type is not possible');
400+
}
401+
402+
$response = new BinaryFileResponse($file);
394403

395404
$request = Request::create('/');
396405
$response->prepare($request);

0 commit comments

Comments
 (0)