Skip to content

feat: extract ApiTestCase in its own api-platform/test package - #7887

Merged
soyuka merged 1 commit into
api-platform:mainfrom
Maxcastel:extract-ApiTestCase-api-platform/test-package
Sep 11, 2026
Merged

feat: extract ApiTestCase in its own api-platform/test package#7887
soyuka merged 1 commit into
api-platform:mainfrom
Maxcastel:extract-ApiTestCase-api-platform/test-package

Conversation

@Maxcastel

@Maxcastel Maxcastel commented Mar 27, 2026

Copy link
Copy Markdown
Contributor
Q A
Branch? main
Tickets Closes #6920
License MIT
Doc PR api-platform/docs#2276

@Maxcastel Maxcastel changed the title feat: extract ApiTestCase in it's own api-platform/test package feat: extract ApiTestCase in its own api-platform/test package Mar 30, 2026
@Maxcastel
Maxcastel force-pushed the extract-ApiTestCase-api-platform/test-package branch from d83c7ed to 918239d Compare March 30, 2026 08:22
@Maxcastel
Maxcastel marked this pull request as ready for review March 30, 2026 08:23
@Maxcastel
Maxcastel force-pushed the extract-ApiTestCase-api-platform/test-package branch 3 times, most recently from 4a85e68 to 721fd65 Compare May 15, 2026 21:01
@Maxcastel

Copy link
Copy Markdown
Contributor Author

Rebased onto #7971, waiting for it to be merged into main. Will rebase onto main once it’s merged.

@Maxcastel
Maxcastel force-pushed the extract-ApiTestCase-api-platform/test-package branch 2 times, most recently from f7c15b4 to 91a2c80 Compare September 3, 2026 14:11
@Maxcastel
Maxcastel force-pushed the extract-ApiTestCase-api-platform/test-package branch from 91a2c80 to 6166b25 Compare September 3, 2026 14:27
@soyuka
soyuka merged commit 711f006 into api-platform:main Sep 11, 2026
112 of 113 checks passed
soyuka added a commit that referenced this pull request Sep 11, 2026
* fix(test): use the extracted ApiTestCase namespace

#7887 moved the test helpers to ApiPlatform\Test and deleted
src/Symfony/Bundle/Test. 11 test files still referenced the old FQCN,
either merged on main after #7887 or brought up from 4.3/4.4. The
resulting fatal took down the whole PHPUnit matrix and PHPStan.

Also stubs getFunction('csp_nonce') on the Twig double in
EntrypointActionTest: #8310 updated GraphiQlActionTest but missed this
one, which builds the same GraphiQlAction.

* feat(symfony): deprecate the moved test helper classes

#7887 moved eight public classes out of api-platform/symfony without a
deprecation path, so user test suites extending ApiTestCase break on a
plain "class not found". Restore them at the old FQCNs as deprecated
shims delegating to ApiPlatform\Test.

Client, Response, ArraySubset and MatchesJsonSchema are final and
cannot be subclassed, so they are class_alias'd; the traits are wrapped;
ApiTestCase subclasses. Adds api-platform/test and
symfony/deprecation-contracts to the component requirements.

* fix(symfony): satisfy cs-fixer and phpstan on the shims

CS Fixer's fully_qualified_strict_types applies to docblocks, so the
{@see} tags must use the imported alias. PHPStan reports trait.unused
for the three trait shims, which exist only for BC and are legitimately
used nowhere in the monorepo.

* fix: drop phpstan ignores left dead by #8517

#8517 removed the Request::getContentType() fallbacks and the
method_exists() guards around getContentTypeFormat(), but kept the
ignore patterns targeting them, so phpstan reports them as unmatched.
Neither has a call site left.
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.

extract ApiTestCase in it's own api-platform/test package

2 participants