Conversation
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
There was a problem hiding this comment.
Code Review
This pull request updates the media import test to use an empty file for STDIN simulation and adds a check for the mime_content_type function to prevent fatal errors when the fileinfo extension is missing. Feedback suggests that simply defaulting to an empty string when the function is unavailable will still cause import failures due to missing file extensions; therefore, a fallback mechanism using getimagesize() is recommended to improve robustness.
There was a problem hiding this comment.
Pull request overview
This PR aims to improve Windows compatibility for the media import workflow/tests by avoiding platform-specific assumptions and by hardening STDIN import MIME detection against missing PHP functions.
Changes:
- Guard
mime_content_type()usage during STDIN imports to avoid fatal errors when the function is unavailable. - Update the Behat scenario for “no STDIN input provided” to avoid using
/dev/null.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Media_Command.php |
Adds a safe fallback when mime_content_type() is not available during STDIN imports. |
features/media-import.feature |
Adjusts the STDIN “no input” test to use an empty file instead of /dev/null. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.