Description
Three content-type tests guard on MimeTypes::class and skip, but symfony/mime is installed nowhere, so they verify nothing in CI.
Update (maintainer decision): symfony/mime stays optional — src/ never references it (detection happens inside Symfony's own BinaryFileResponse::prepare()). Do not fix this by adding the package to require-dev; instead make the tests cover the behavior the bundle actually ships, i.e. the without-mime path. (testContentLengthMatchesFileSize already sets Content-Type explicitly "to avoid MIME type detection dependency" — same idea.)
Where
Suggested fix
- Rewrite the 3 tests so they execute without the package: set
Content-Type explicitly where the test is not about detection, and assert the fallback content type Symfony produces when mime guessing is unavailable (e.g. unknown extension).
- Drop the
class_exists guards so the tests always run instead of silently skipping.
- Optional: consider a
suggest entry for symfony/mime in composer.json documenting the enhancement; with-mime auto-detection itself stays out of scope for the suite.
Description
Three content-type tests guard on
MimeTypes::classand skip, butsymfony/mimeis installed nowhere, so they verify nothing in CI.Update (maintainer decision):
symfony/mimestays optional —src/never references it (detection happens inside Symfony's ownBinaryFileResponse::prepare()). Do not fix this by adding the package torequire-dev; instead make the tests cover the behavior the bundle actually ships, i.e. the without-mime path. (testContentLengthMatchesFileSizealready setsContent-Typeexplicitly "to avoid MIME type detection dependency" — same idea.)Where
tests/StreamedBinaryFileResponseTest.php:59,74,89Suggested fix
Content-Typeexplicitly where the test is not about detection, and assert the fallback content type Symfony produces when mime guessing is unavailable (e.g. unknown extension).class_existsguards so the tests always run instead of silently skipping.suggestentry forsymfony/mimeincomposer.jsondocumenting the enhancement; with-mime auto-detection itself stays out of scope for the suite.