How to run Behat tests when there are errors of level E_USER_DEPRECATED

旧巷老猫 提交于 2019-12-01 13:23:09

So I got it. This file gave me the required hint: https://github.com/Behat/Behat/blob/master/features/error_reporting.feature#L100-L101

To get the required integer, I used php -r "echo E_ALL & ~E_USER_DEPRECATED;" which yielded 16383. So I put this into my behat.yml:

    calls:
        error_reporting: 16383

After that Behat finally did not break, but it did show ugly exception-traces. So I put back the call to error_reporting in FeatureContext.php, right before the class definition:

error_reporting(error_reporting() & ~E_USER_DEPRECATED);

Now Behat ignores all errors of level E_USER_DEPRECATED and I guess I will keep it that way until I start using Symfony 3.

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