Is there a way to have Behat NOT fail on PHP Notice errors?

試著忘記壹切 提交于 2019-11-30 10:17:58

EDIT: This will work for v2.x of Behat. For v > 3.x see Alexander Haas answer below.

Finally found it! By digging in the code, I found that Behat has a way to change the error reporting level. Just do

define('BEHAT_ERROR_REPORTING', E_ERROR | E_WARNING | E_PARSE);

in the FeatureContext.php file. It does the trick!

Afterwards, I googled the constant and found this in the changelog:

  • Added BEHAT_ERROR_REPORTING constant to change error_repoting level
Alexander Haas

For Behat 3 see my question and answer: How to run Behat tests when there are errors of level E_USER_DEPRECATED

BEHAT_ERROR_REPORTING is dropped in favor of a configuration value.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!