You are here

public function UploadedFileTest::testFileUploadsWithNoMimeType in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php \Symfony\Component\HttpFoundation\Tests\File\UploadedFileTest::testFileUploadsWithNoMimeType()

File

vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php, line 36

Class

UploadedFileTest

Namespace

Symfony\Component\HttpFoundation\Tests\File

Code

public function testFileUploadsWithNoMimeType() {
  $file = new UploadedFile(__DIR__ . '/Fixtures/test.gif', 'original.gif', null, filesize(__DIR__ . '/Fixtures/test.gif'), UPLOAD_ERR_OK);
  $this
    ->assertEquals('application/octet-stream', $file
    ->getClientMimeType());
  if (extension_loaded('fileinfo')) {
    $this
      ->assertEquals('image/gif', $file
      ->getMimeType());
  }
}