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


i have symfony 2.7 form type causing errors of level e_user_deprecated. errors not come own code vendor/symfony/symfony/src/symfony/bridge/doctrine/form/type/doctrinetype.php.

in dev mode using web browser, can access page using said form fine. wdt show me deprecated messages form work, page returned status 200.

using behat 3 (with behat\symfony2extension\driver\kerneldriver , behat\mink\driver\browserkitdriver), request same url returns status 500 server error. stack trace in response shows deprecated errors causing exception.

my behat configuration plain described in http://docs.behat.org/en/v3.0/cookbooks/1.symfony2_integration.html

when define('behat_error_reporting', 0); on top of featurecontext.php file suggested https://stackoverflow.com/a/9217606/2342504 there no change in behaviour.

after code scanning, guess constant behat_error_reporting removed in behat 3 , runtimecallhandler::errorreportinglevel used instead.

yet have no idea how configure or set runtimecallhandler::errorreportinglevel.

so got it. file gave me required hint: https://github.com/behat/behat/blob/master/features/error_reporting.feature#l100-l101

to required integer, used php -r "echo e_all & ~e_user_deprecated;" yielded 16383. put behat.yml:

    calls:         error_reporting: 16383 

after behat did not break, did show ugly exception-traces. put call error_reporting in featurecontext.php, right before class definition:

error_reporting(error_reporting() & ~e_user_deprecated); 

now behat ignores errors of level e_user_deprecated , guess keep way until start using symfony 3.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -