I'm using PHPUnit 4.8 on a PHP 5.3.29 install. Some of the code in our application makes use of the deprecated mysql_* functionality, and PHPUnit converts the deprecation notices of these instances to exceptions and in turn fails those specific testcases.
Now I've already included the convertErrorsToExceptions="false" in the config.xml but this doesn't seem to help as it's still happening.
Can anyone help shed some light on what might be happening here?
Cheers!
EDIT: Added example files on gist.github.com
if you are looking solution for Symfony 3.1 and higher versions, the answer is
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" />
The convertErrorsToExceptions="false" configuration option only controls the conversion of E_ERROR to exceptions. A deprecation is represented as E_DEPRECATED, though.
A configuration option is missing for controlling the conversion of E_DEPRECATED to exceptions. This will be added in PHPUnit 6.2. This will not be backported to PHPUnit 4.8, the version of PHPUnit you are using, as that version has reached its end of life.
In your bootstrap script you can set PHPUnit_Framework_Error_Deprecated::$enabled = false;, though, which will disable the conversion of E_DEPRECATED to exceptions.
If anyone is looking for a Symfony/Drupal related solution, a quick way can be to set the env variable in your test file(I needed it because deprecation warnings were coming from a third party repo).
putenv('SYMFONY_DEPRECATIONS_HELPER=disabled');