Conversation
ViniTou
force-pushed
the
phpunit-11-deprecation-gate
branch
from
September 17, 2026 16:30
fcddfc5 to
6511d75
Compare
…ByExpressionTest (cherry picked from commit b3d2551)
… native deprecation gate
ViniTou
force-pushed
the
phpunit-11-deprecation-gate
branch
from
September 18, 2026 10:30
6511d75 to
3a702d3
Compare
…HPUnit 9 convert*ToExceptions strictness
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description:
SYMFONY_DEPRECATIONS_HELPER(max[...]thresholds) is dead under PHPUnit 11: phpunit-bridge'sbootstrap.phpreturns early andSymfonyExtensionregisters noDeprecationErrorHandler, so the old threshold was silently doing nothing. This PR replaces it with PHPUnit 11's native deprecation gate:failOnDeprecation="true"+displayDetailsOnTestsThatTriggerDeprecations="true"on the root<phpunit>element, plus a<source baseline="...">block (ignoreIndirectDeprecations="false",ignoreSuppressionOfDeprecations="true",<include><directory>src</directory></include>, coveringsrc/lib,src/bundle,src/contracts,src/internal-contractsper the psr-4 autoload) so any new deprecation fails the suite while existing ones are baselined.ignoreIndirectDeprecationsisfalse(nottrue): PHPUnit classifies a Symfony deprecation triggered from our code as "indirect" (the immediate caller isdeprecation-contracts/function.php), sotruewould silently drop deprecated-vendor-API usages from our own code —falsecatches those too, while the baseline still limits the gate to genuinely new deprecations.Per config:
phpunit.xml(unit/bundle suites) — gated. Baseline regenerated on PHP 8.4 (CI's highest matrix version):phpunit.baseline.xml, 15 issues (704 tests, exit 0, "15 issues were ignored by baseline") — all 15 are external (vendor-originatedctype_digit()deprecations); 0 internal (Since ibexa/...) messages. The 8.4 regeneration produced byte-identical output to the prior 8.3 baseline (no PHP-8.4-only deprecations were triggered by this repo's suite). Verified passing under both PHP 8.4 and PHP 8.3, each printing "15 issues were ignored by baseline" (exit 0 on both). Probe verified: injectingtrigger_deprecation()intoRoleTransformer::transform()made the suite fail (exit 1); removed afterwards (git diff -- srcempty), suite passes again (exit 0).phpunit.integration.xml— gate not enabled: only the deadSYMFONY_DEPRECATIONS_HELPERenv line was removed. The suite cannot currently boot to completion in this environment (Symfony test container build fails, and further along the JMS translation extractor requires a Node.js runtime with@typescript-eslint/typescript-estreethat isn't available locally), so no baseline could be generated. Left ungated for now; enabling it is future work once it can run to completion (e.g. in CI).To refresh the baseline: with a real (non-symlinked)
vendor/and PHPUnit 11 installed, runvendor/bin/phpunit -c phpunit.xml --generate-baseline phpunit.baseline.xml.Merge note: this branch is stacked on the still-open
phpunit-11PR (this PR targetsphpunit-11, notmain) — thephpunit-11PR must merge first.Two follow-up commits on top of the above:
failOnWarning="true"/failOnNotice="true"on the root<phpunit>element of bothphpunit.xmlandphpunit.integration.xml. PHPUnit 9'sconvertErrorsToExceptions/convertNoticesToExceptions/convertWarningsToExceptionswere removed by the wave PR without their PHPUnit 10+ replacements, so notices and warnings were silently no longer failing the suite.phpunit.integration.xmlalready hadfailOnWarning; onlyfailOnNoticewas missing there.symfony/phpunit-bridgedependency:require-devincomposer.jsonand the<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension"/>line from both configs (theDAMA\DoctrineTestBundleextension inphpunit.integration.xmlis untouched). The repo has zero usage ofClockMock,DnsMock,ExpectDeprecationTrait,expectDeprecation(), orSYMFONY_DEPRECATIONS_HELPER— the extension only wired those, and its deprecation handler is already inert under PHPUnit 11.composer why symfony/phpunit-bridgeconfirms nothing else in the tree requires it.For QA:
N/A
Documentation:
N/A