FriendsOfBehat / SymfonyExtension

:musical_score: Extension integrating Behat with Symfony.
MIT License
472 stars 62 forks source link

Enabling the Symfony error handler when APP_DEBUG is set to 1 #148

Open adrian-gheorghe opened 3 years ago

adrian-gheorghe commented 3 years ago

Hello,

On our project we've recently run into an issue that was only reproducible on environments where the APP_DEBUG env var is set to 1 (making Symfony throw exceptions for notices). Our behat tests were still passing, because although APP_DEBUG is enabled in our .env.test file, the bin/behat file does not enable the Symfony debug error handler (Debug::enable()) in the same way public/index.php or bin/console do.

Is there a way to make Debug::enable() run as well by configuration? (we've done that using a BeforeSuite hook for now) If not, is this something that is desired? Since tests should be as strict as possible, maybe having that as an option would be beneficial.

Thank you