forked from api-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collection of Resource Metadata implementation (api-platform#4351)
* chore(ci): php 8 on php-cs-fixer and phpstan * chore: Create the new namespace * feat(metadata): Resource Collection * feat(graphql): graphql resource metadata collection * chore(graphql): Change namespace to ApiPlatform\GraphQl * chore(test): move fixtures and tests * chore(tests): flag @legacy tests * chore(ci): Behat symfony 5.4 * chore: phpstan false positive * feat(mongodb): resource metadata collection * fixes for php 7 * fix: Behat Elasticsearch * chore(phpstan): non-empty-string * test: fix tests * Changelog Co-authored-by: Vincent Chalamon <[email protected]>
- Loading branch information
1 parent
24eb718
commit 1259ee5
Showing
1,480 changed files
with
16,913 additions
and
5,111 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
Feature: Resource attributes | ||
In order to use the Resource attribute | ||
As a developer | ||
I should be able to fetch data from a state provider | ||
|
||
@php8 | ||
@!mysql | ||
@!mongodb | ||
Scenario: Retrieve a Resource collection | ||
When I add "Content-Type" header equal to "application/ld+json" | ||
And I send a "GET" request to "/attribute_resources" | ||
Then the response status code should be 200 | ||
And the response should be in JSON | ||
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" | ||
And the JSON should be equal to: | ||
""" | ||
{ | ||
"@context": "/contexts/AttributeResources", | ||
"@id": "/attribute_resources", | ||
"@type": "hydra:Collection", | ||
"hydra:member": [ | ||
{ | ||
"@id": "/attribute_resources/1", | ||
"@type": "AttributeResource", | ||
"identifier": 1, | ||
"name": "Foo" | ||
}, | ||
{ | ||
"@id": "/attribute_resources/2", | ||
"@type": "AttributeResource", | ||
"identifier": 2, | ||
"name": "Bar" | ||
} | ||
] | ||
} | ||
""" | ||
|
||
@php8 | ||
@!mysql | ||
@!mongodb | ||
Scenario: Retrieve the first resource | ||
When I add "Content-Type" header equal to "application/ld+json" | ||
And I send a "GET" request to "/attribute_resources/1" | ||
Then the response status code should be 200 | ||
And the response should be in JSON | ||
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" | ||
And the JSON should be equal to: | ||
""" | ||
{ | ||
"@context": "/contexts/AttributeResource", | ||
"@id": "/attribute_resources/1", | ||
"@type": "AttributeResource", | ||
"identifier": 1, | ||
"name": "Foo" | ||
} | ||
""" | ||
|
||
@php8 | ||
@!mysql | ||
@!mongodb | ||
Scenario: Retrieve the aliased resource | ||
When I add "Content-Type" header equal to "application/ld+json" | ||
And I send a "GET" request to "/dummy/1/attribute_resources/2" | ||
Then the response status code should be 301 | ||
And the header "Location" should be equal to "/attribute_resources/2" | ||
And the response should be in JSON | ||
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" | ||
And the JSON should be equal to: | ||
""" | ||
{ | ||
"@context": "/contexts/AttributeResource", | ||
"@id": "/attribute_resources/2", | ||
"@type": "AttributeResource", | ||
"identifier": 2, | ||
"dummy": "/dummies/1", | ||
"name": "Foo" | ||
} | ||
""" | ||
|
||
@php8 | ||
@!mysql | ||
@!mongodb | ||
Scenario: Patch the aliased resource | ||
When I add "Content-Type" header equal to "application/merge-patch+json" | ||
And I send a "PATCH" request to "/dummy/1/attribute_resources/2" with body: | ||
""" | ||
{"name": "Patched"} | ||
""" | ||
Then the response status code should be 301 | ||
And the header "Location" should be equal to "/attribute_resources/2" | ||
And the response should be in JSON | ||
And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8" | ||
And the JSON should be equal to: | ||
""" | ||
{ | ||
"@context": "/contexts/AttributeResource", | ||
"@id": "/attribute_resources/2", | ||
"@type": "AttributeResource", | ||
"identifier": 2, | ||
"dummy": "/dummies/1", | ||
"name": "Patched" | ||
} | ||
""" |
This file contains 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
Oops, something went wrong.