8000 minor #47762 [HttpFoundation]  skip a test if the mime type detection… · enumag/symfony@4d70aa9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d70aa9

Browse files
committed
minor symfony#47762 [HttpFoundation]  skip a test if the mime type detection feature will not work (xabbuh)
This PR was merged into the 4.4 branch. Discussion ---------- [HttpFoundation]  skip a test if the mime type detection feature will not work | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Commits ------- 47dedf7 skip a test if the mime type detection feature will not work
2 parents c959125 + 47dedf7 commit 4d70aa9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Symfony/Component/HttpFoundation/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)
0