Please don't register the error handler for the integration test case. The normal use of a form should not leak deprecation warnings. I removed it from 2.2 as the testsuite was passing whereas projects were showing deprecations. the testsuite should allow catching such things.
If you have a test for the BC layer, add the error handler only in this integration test