Skip to content

Commit

Permalink
skip a test if the mime type detection feature will not work
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 1, 2022
1 parent 9aeb286 commit 7eea76a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Tests/BinaryFileResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\HttpFoundation\Tests;

use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\Stream;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
Expand Down Expand Up @@ -390,7 +391,15 @@ public function testPrepareNotAddingContentTypeHeaderIfNoContentResponse()

public function testContentTypeIsCorrectlyDetected()
{
$response = new BinaryFileResponse(__DIR__.'/File/Fixtures/test.gif');
$file = new File(__DIR__.'/File/Fixtures/test.gif');

try {
$file->getMimeType();
} catch (\LogicException $e) {
$this->markTestSkipped('Guessing the mime type is not possible');
}

$response = new BinaryFileResponse($file);

$request = Request::create('/');
$response->prepare($request);
Expand Down

0 comments on commit 7eea76a

Please sign in to comment.