Symfony’s deprecation warnings while running tests is a great service to keep track with upcoming changes in newer symfony versions.
However these warnings can break your CI/CD pipeline and sometimes you cant fix all deprecation warnings immediatly.
To disable them you can set the ENV var
and the warnings will not be displayed anymore and CI/CD will pass again.
Update from comments:
does also work and will still show the deprecation warnings count. (Thx Max)
This was introduced a while ago with this PullRequest and works for symfony >= 3.1.
So for running the tests manually, do like this:
Or add it to the phpunit.xml
<php> <ini name="error_reporting" value="-1" /> <env name="KERNEL_CLASS" value="App\Kernel" /> ... <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" /> </php>
With bitbucket pipelines it looks like this:
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- SYMFONY_DEPRECATIONS_HELPER=disabled composer test
- composer check-style