You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tests: detect the deprecations and boot a kernel #303
The deprecations are not detected by the test suite: no failOnDeprecation, no symfony/phpunit-bridge, no SYMFONY_DEPRECATIONS_HELPER (symfony/test-pack only brings phpunit, browser-kit and css-selector, unused here). The deprecations triggered with trigger_deprecation() are silenced (@trigger_error()), so PHPUnit ignores them by default, and the @final since 5.4 annotations (Define the public API: mark classes final or internal #279) need the DebugClassLoader. A deprecated feature still used internally, or a deprecation of Symfony, goes unnoticed until the next major.
No test boots a kernel (FrameworkBundle + this bundle) nor compiles the full container: the DI tests load the extension into a bare ContainerBuilder without compile(). A broken reference (e.g. @property_accessor, @debug.stopwatch, @kernel) or a compiler pass ordering issue is only detected in an application.
Proposed fix
Fail the tests on deprecations: failOnDeprecation="true", <source ignoreSuppressionOfDeprecations="true"> restricted to the deprecations caused by this bundle's code (ignoreIndirectDeprecations / ignoreSelfDeprecations, or the phpunit-bridge baseline), DebugClassLoader::enable() in the bootstrap. To check with the lowest supported PHPUnit (10.5) and the lowest CI job; the tests of deprecated features expect their deprecation explicitly.
Add a functional test booting a minimal kernel (FrameworkBundle, MonologBundle if needed, this bundle) with a small process configuration: the container compiles, every bundle task and transformer is resolvable by its code, and the process runs.
Activity
#303 - Tests: detect the deprecations and boot a kernel
Merge pull request #304 from cleverage/303