Skip to content

fix(symfony): make api-platform/test a dev dependency - #8527

Merged
soyuka merged 1 commit into
api-platform:mainfrom
soyuka:fix/symfony-test-dev-dependency
Sep 11, 2026
Merged

fix(symfony): make api-platform/test a dev dependency#8527
soyuka merged 1 commit into
api-platform:mainfrom
soyuka:fix/symfony-test-dev-dependency

Conversation

@soyuka

@soyuka soyuka commented Sep 11, 2026

Copy link
Copy Markdown
Member

Fixes the Guides job, red on main since #8526.

What broke

#8526 added api-platform/test to the require section of src/Symfony/composer.json. That made it reachable from docs/composer.json (which requires api-platform/symfony), where pmu links it as @dev:

api-platform/symfony dev-… requires api-platform/test @dev
  -> api-platform/test dev-… requires phpunit/phpunit ^11.5 || ^12.2
  -> conflicts with root composer.json require (^10)

Dependency resolution fails outright, so the guides job dies at Install project dependencies and 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 is 515b6f468, exactly the commit that added the require entry. 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: require would pull PHPUnit into every production install of api-platform/symfony.

The precedent is already in the codebase. On 4.4, when api-platform/symfony still shipped the ApiTestCase helpers itself:

"require":     { …no phpunit… }
"require-dev": { "phpunit/phpunit": "^11.5 || ^12.2" }

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 a suggest entry so users of the deprecated classes know what to install.

symfony/deprecation-contracts deliberately stays in require — the shim files call trigger_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. UriVariableParameterProviderTest calls recreateSchema() in setUp() while its markTestSkipped() mongodb guards sit inside the test bodies, and tests/Fixtures/TestBundle/Document/Base64UriVariableDummy.php does not exist. Left for a separate change.

https://claude.ai/code/session_01FmRmcWx8J7PS374edGFBdE

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
@soyuka
soyuka merged commit 239e44c into api-platform:main Sep 11, 2026
110 of 117 checks passed
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