File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Component \HttpFoundation \Tests ;
13
13
14
14
use Symfony \Component \HttpFoundation \BinaryFileResponse ;
15
+ use Symfony \Component \HttpFoundation \File \File ;
15
16
use Symfony \Component \HttpFoundation \File \Stream ;
16
17
use Symfony \Component \HttpFoundation \Request ;
17
18
use Symfony \Component \HttpFoundation \ResponseHeaderBag ;
@@ -390,7 +391,15 @@ public function testPrepareNotAddingContentTypeHeaderIfNoContentResponse()
390
391
391
392
public function testContentTypeIsCorrectlyDetected ()
392
393
{
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 );
394
403
395
404
$ request = Request::create ('/ ' );
396
405
$ response ->prepare ($ request );
You can’t perform that action at this time.
0 commit comments