Skip to content

Commit

Permalink
[DependencyInjection] Fix CSV file mime type guess test for PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Jun 8, 2021
1 parent 2d699e3 commit 117cb8f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Symfony/Component/Mime/Tests/MimeTypesTest.php
Expand Up @@ -75,7 +75,12 @@ public function testCustomMimeTypes()
}

/**
* PHP 8 detects .csv files as "application/csv" while PHP 7 returns "text/plain".
* PHP 8 detects .csv files as "application/csv" (or "text/csv", depending
* on your system) while PHP 7 returns "text/plain".
*
* "text/csv" is described by RFC 7111.
*
* @see https://datatracker.ietf.org/doc/html/rfc7111
*
* @requires PHP 8
*/
Expand All @@ -84,7 +89,7 @@ public function testCsvExtension()
$mt = new MimeTypes();

$mime = $mt->guessMimeType(__DIR__.'/Fixtures/mimetypes/abc.csv');
$this->assertSame('application/csv', $mime);
$this->assertContains($mime, ['application/csv', 'text/csv']);
$this->assertSame(['csv'], $mt->getExtensions($mime));
}
}

0 comments on commit 117cb8f

Please sign in to comment.