fix(symfony): make api-platform/test a dev dependency - #8527
Merged
Conversation
api-platform#8526 added api-platform/test to require, but it pulls phpunit ^11.5 || ^12.2 into every production install and breaks the Guides job, whose docs/composer.json pins phpunit ^10. 4.4 keeps phpunit in require-dev while still shipping the same helpers; the shims only load from test code, so require-dev plus a suggest entry matches that precedent. Claude-Session: https://claude.ai/code/session_01FmRmcWx8J7PS374edGFBdE
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.
Fixes the
Guidesjob, red on main since #8526.What broke
#8526 added
api-platform/testto therequiresection ofsrc/Symfony/composer.json. That made it reachable fromdocs/composer.json(which requiresapi-platform/symfony), where pmu links it as@dev:Dependency resolution fails outright, so the guides job dies at
Install project dependenciesand nothing downstream runs.The green/red boundary is a single commit: the guides run on
c587c81e0— which already contained #7887 — was green; the first red one is515b6f468, exactly the commit that added therequireentry. So this is #8526's doing, not the original extraction's.Why require-dev is the right fix, not bumping docs' phpunit
This is a packaging bug independent of CI:
requirewould pull PHPUnit into every production install ofapi-platform/symfony.The precedent is already in the codebase. On 4.4, when
api-platform/symfonystill shipped theApiTestCasehelpers itself:Test helpers ship in the package; their test-only dependencies stay dev-only. The deprecated shims at
ApiPlatform\Symfony\Bundle\Test\*are only ever loaded from test code, so they get the same treatment, plus asuggestentry so users of the deprecated classes know what to install.symfony/deprecation-contractsdeliberately stays inrequire— the shim files calltrigger_deprecation()at file scope in shipped code, so it is a genuine runtime dependency.Not included
PHPUnit (PHP 8.5) (MongoDB)is also red on main, but it is unrelated and pre-existing — it was merged red in #8491 on 2026-09-02 and was merely masked on main by #7887's bootstrap fatal.UriVariableParameterProviderTestcallsrecreateSchema()insetUp()while itsmarkTestSkipped()mongodb guards sit inside the test bodies, andtests/Fixtures/TestBundle/Document/Base64UriVariableDummy.phpdoes not exist. Left for a separate change.https://claude.ai/code/session_01FmRmcWx8J7PS374edGFBdE