Skip to content

IBX-12606: Replaced the Symfony deprecation thresholds with PHPUnit's native deprecation gate - #28

Open
ViniTou wants to merge 2 commits into
6.0from
phpunit-11-deprecation-gate
Open

ViniTou wants to merge 2 commits into
6.0from
phpunit-11-deprecation-gate

Conversation

@ViniTou

@ViniTou ViniTou commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-12606

Description:

SYMFONY_DEPRECATIONS_HELPER is dead under PHPUnit 11 (phpunit-bridge's bootstrap returns early, no DeprecationErrorHandler is registered), so any thresholds would silently do nothing. This repo's single phpunit.xml.dist had no such env var set to begin with. This switches it to PHPUnit 11's native failOnDeprecation + <source baseline="..."> mechanism, which fails the run on any new deprecation triggered by src/ while ignoring what's already in the baseline.

phpunit.xml.dist (only config, covers bundle/integration/lib suites, all in-process — no separate kernel-booting bootstrap): gated. failOnDeprecation + <source baseline="phpunit.baseline.xml"> added, with ignoreIndirectDeprecations="false" (so a deprecated vendor method called from our code is still caught, not just deprecations we trigger ourselves) and ignoreSuppressionOfDeprecations="true". Baseline: 0 issues (0 internal Since ibexa/…, 0 external). Could not run the step-4 probe (add trigger_deprecation() to a src/ method and confirm the suite fails): tests/bundle, tests/integration and tests/lib are all empty (only .gitkeep), so there is no existing test to exercise a probe against. The mechanism itself, including the indirect-deprecation case, is the same one verified working end-to-end on ibexa/content-tree and ibexa/core-persistence in sibling PRs, so it's wired correctly here too — it just has nothing to catch yet.

To refresh the baseline: composer install --no-progress (real vendor/, not a symlink), then vendor/bin/phpunit -c phpunit.xml.dist --generate-baseline phpunit.baseline.xml.

Not stacked — based on 6.0 (this repo's PHPUnit 11 migration is already merged).

  • Baselines are generated on PHP 8.4 (CI's highest matrix version); PHP-native deprecations from vendor code (e.g. league/flysystem implicit-nullable parameters) only fire there. Regenerate with the highest PHP version in the matrix.
  • Also restored failOnNotice="true" on phpunit.xml.dist (it already had failOnWarning="true"). PHPUnit 9's convertNoticesToExceptions/convertWarningsToExceptions were dropped in the PHPUnit 11 migration; their PHPUnit 11 replacements default to false, so notices (and, until now, warnings were already covered) were silently not failing the run.
  • No symfony/phpunit-bridge dependency exists in this repo's composer.json, and no ClockMock/DnsMock/ExpectDeprecationTrait/expectDeprecation()/SYMFONY_DEPRECATIONS_HELPER usage was found — nothing to remove or convert.

For QA:

N/A

Documentation:

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant