Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mime] Fix CSV file mime type guess test for PHP 8.1 #41614

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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));
}
}