Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore(tests): reorganize Functional/ by feature scope#7958

Merged
soyuka merged 2 commits into
api-platform:4.3from
soyuka:tests/4.3-functional-cleanup
May 7, 2026
Merged

chore(tests): reorganize Functional/ by feature scope#7958
soyuka merged 2 commits into
api-platform:4.3from
soyuka:tests/4.3-functional-cleanup

Conversation

@soyuka
Copy link
Copy Markdown
Member

@soyuka soyuka commented May 7, 2026

Q A
Branch? 4.3
Tickets -
License MIT
Doc PR -

Summary

Cleans up tests/Functional/ so new contributions land in predictable, feature-scoped locations instead of accumulating as IssueNNNNTest.php at root or under Issues/.

  • delete Functional/Issues/ — every test in it had a clear feature scope; folded or moved each one
  • move root issue-numbered testsIssue7354TestParameters/BooleanQueryParameterDefaultTest, Issue7490Test folded into ErrorTest
  • fold single-method regressions into existing feature tests when the scope matches:
    • Issues/Issue6926TestErrorTest::testErrorResourceThrownFromProcessorRespectsGroups
    • Issues/Issue7490TestErrorTest::testDataUriExceptionMessageIsNotWrapped
  • standalone moves for tests with a distinct scope:
    • Issues/Issue7135TestUuid/UuidIriRelationTest
    • Issues/Issue7349TestDoctrine/PartialPaginationMongoDbTest
  • rename 5 IssueNNN/ fixture dirs to feature names (BooleanQueryParameterDefault/, DataUriFileUpload/, ErrorResourceWithGroups/, PartialPaginationMongo/, UuidIriRelation/); the other 13 existing IssueNNN/ fixture dirs are left alone to avoid touching unrelated tests
  • move DefaultParametersAppKernel.php out of the test root into Functional/Kernel/ (it's not a test); 2 callsites updated
  • rename HALCircularReference.phpHalCircularReferenceTest.php

Latent bug surfaced

HALCircularReference.php was missing the Test suffix, so PHPUnit's default *Test.php discovery had never picked it up — the class also lacked SetupClassResourcesTrait, so even if discovered it would have 404'd. Both fixed in this PR (rename + add trait); the test now actually runs and passes.

Test plan

  • vendor/bin/phpunit tests/Functional/ErrorTest.php — 8/8 (was 6/6, +2 from folds)
  • vendor/bin/phpunit tests/Functional/HalCircularReferenceTest.php — 1/1 (newly running)
  • vendor/bin/phpunit tests/Functional/Uuid/UuidIriRelationTest.php — 3/3
  • vendor/bin/phpunit tests/Functional/Parameters/BooleanQueryParameterDefaultTest.php — 3/3
  • vendor/bin/phpunit tests/Functional/Doctrine/PartialPaginationMongoDbTest.php — 2 skipped (MongoDB-only, expected outside MongoDB env)
  • vendor/bin/phpunit tests/Functional/DefaultParametersTest.php tests/Functional/JsonSchema/JsonSchemaWithDefaultParametersTest.php — 4/4 (verifies kernel move callsites)
  • vendor/bin/phpunit tests/Functional/Uuid/ tests/Functional/Doctrine/ tests/Functional/Parameters/ — 431 tests, 0 failures
  • CI: full suite + MongoDB run

Forward-merge note

Deliberately did not create JsonLd/ or Hal/ subdirs or split monolithic format tests on 4.3 — those are surfacing on main and any premature reshuffle here would create merge pain.

soyuka added 2 commits May 7, 2026 12:39
| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Tickets       | -
| License       | MIT
| Doc PR        | -

* delete Functional/Issues/, fold or move its 3 tests to feature-scoped paths
* move Issue7354/Issue7490 root tests to Parameters/ and ErrorTest fold
* rename 5 IssueNNN/ fixture dirs to feature names
* move DefaultParametersAppKernel to Functional/Kernel/
* rename HALCircularReference.php to HalCircularReferenceTest.php and add
  missing SetupClassResourcesTrait (file was never run by PHPUnit before
  due to filename mismatch with *Test.php discovery)
The kernel is a test fixture, not a test. It now lives in
tests/Fixtures/app/ in the global namespace, alongside the parent
AppKernel it extends, and is loaded via bootstrap.php require.
@soyuka soyuka merged commit 88939eb into api-platform:4.3 May 7, 2026
118 of 119 checks passed
@soyuka soyuka deleted the tests/4.3-functional-cleanup branch May 7, 2026 11:27
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