feat: extract ApiTestCase in its own api-platform/test package#7887
Open
Maxcastel wants to merge 6 commits into
Open
feat: extract ApiTestCase in its own api-platform/test package#7887Maxcastel wants to merge 6 commits into
Maxcastel wants to merge 6 commits into
Conversation
d83c7ed to
918239d
Compare
Replaces 13 behat features (xml, issues, sub_resources, push_relations, mercure, json, http_cache, filter) with functional ApiTestCase tests under tests/Functional/. Scenarios map 1:1; sequential behat scenarios (http_cache tags, m2m tag_collector) are consolidated into single test methods that walk through the same sequence with NullPurger resets. New PropertyFilterTest covers resource-relation sparse fieldsets through both #[ApiFilter(PropertyFilter::class)] and #[QueryParameter(filter: ...)] on a new isolated fixture pair (SparseFieldsetParent/Child); the non- resource scenario is already covered by NonResourceTest. TagCollectorTest installs the custom TagCollectorCustom via \$container->set() + KernelBrowser::disableReboot() so the override survives across requests — same pattern as Behat HttpCacheContext. Doctrine, GraphQL, MongoDB, Main, Elasticsearch, Security and Serializer feature sets are intentionally out of scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hods Auto-increment IDs in MongoDB ODM are tracked in a separate doctrine_increment_ids collection that persisted across recreateSchema() calls, causing IDs to leak between test methods. Drop it alongside the document collections.
cfe90e6 to
4a85e68
Compare
…lizableValueException (api-platform#7967) * fix(serializer): translate PropertyAccess type mismatches to NotNormalizableValueException | Q | A | ------------- | --- | Branch? | 4.3 | Tickets | symfony/symfony#64159 | License | MIT | Doc PR | ∅ AbstractItemNormalizer::setAttributeValue() now catches PropertyAccess\InvalidArgumentException and rethrows as NotNormalizableValueException, mirroring the contract ObjectNormalizer implements per symfony/symfony#64067. Without this, null on a non-nullable typed property bubbled up as HTTP 500 instead of a 4xx denormalization error. * chore(serializer): bump symfony/serializer minimum to require setAttributeValue contract | Q | A | ------------- | --- | Branch? | 4.3 | Tickets | symfony/symfony#64067 | License | MIT | Doc PR | ∅ The COLLECT_DENORMALIZATION_ERRORS aggregation in AbstractObjectNormalizer was reworked in symfony/symfony#64067 (released in 6.4.37 / 7.4.9 / 8.0.9). Now that AbstractItemNormalizer implements that contract, older Symfony parents would no longer aggregate our translated exceptions and would respond with 400 instead of 422.
…ocator (api-platform#7968) Symfony 8.1 split json_streamer.value_transformer into property_value_transformer and value_object_transformer. The custom JSON-LD JsonStreamReader/Writer bypassed Symfony's TransformerPass, so DateTimeInterface (and other value objects) were missing from its locator — making the generator emit a Splitter::splitDict call on date-time strings ("JSON is not valid").
…platform#7972) | Q | A | ------------- | --- | Branch? | 4.3 | Tickets | refs api-platform#7966 | License | MIT | Doc PR | ∅ FieldsBuilder called filterLocator->has() with whatever QueryParameter::$filter returned, crashing on object-form filters (new SortFilter()) when the parameter key contained '['. A resolveFilter() helper now handles both string service ids and FilterInterface instances, applied at every locator site.
4a85e68 to
721fd65
Compare
Contributor
Author
|
Rebased onto #7971, waiting for it to be merged into |
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.
Uh oh!
There was an error while loading. Please reload this page.