I've recently upgraded a Symfony app to Symfony 2.7 and at the same time I installed symfony/phpunit-bridge.
On the first run of phpunit following the installation of symfony/phpunit-bridge I received 821 deprecation notices after running the full test suite.
Wanting not to wait for the full test suite to run, I ran just a single test that I could see was raising a deprecation issue. I was hoping that this would run quickly and would then get me one or more deprecation notices to be getting on with fixing.
This second time I ran phpunit there were no deprecation notices. I thought his odd and ran phpunit again, both against the full test suite and against individual tests. Still no deprecation notices.
I considered that perhaps a newer version of phpunit would help. I was using 4.8.34 and decided to switch to ~5.0.
On the next run of phpunit, tada, lots of deprecation notices. Things were looking good.
On the next run of phpunit again, no deprecation notices.
I switched back to phpunit 4.8.34 and ... tada ... deprecation notices just the once.
I'm getting symfony/phpunit-bridge deprecation notices only on the first time it is run. What could be happening to cause this?
Update
I've since noticed that deprecation notices will be presented if the test cache is cleared before running tests.
I also noticed that the notices refer to calls to Symfony\Component\DependencyInjection\Definition::getFactoryService and similar methods.
None of the services defined in the app use factories. This suggests a vendor is in someway doing something odd.
I can make the deprecation notices happen now at will and so will close this question.