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 1212namespace Symfony \Component \HttpFoundation \Tests ;
1313
1414use Symfony \Component \HttpFoundation \BinaryFileResponse ;
15+ use Symfony \Component \HttpFoundation \File \File ;
1516use Symfony \Component \HttpFoundation \File \Stream ;
1617use Symfony \Component \HttpFoundation \Request ;
1718use 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 );
You can’t perform that action at this time.
0 commit comments