Skip to content

Tests: detect the deprecations and boot a kernel #303

Closed

Description

@njoubert-cleverage

Description

  • 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

  1. 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.
  2. 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.

The same work is done in the bridge bundles (cleverage/archive-process-bundle#39, cleverage/cache-process-bundle#57, cleverage/doctrine-process-bundle#58, cleverage/flysystem-process-bundle#59, cleverage/rest-process-bundle#63, cleverage/soap-process-bundle#56, cleverage/ui-process-bundle#181). Found during the Symfony bundle best practices review.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: tests and CI only.

Activity

  1. added 2 commits that reference this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions