Skip to content

Commit

Permalink
Merge e4bf4d1 into 75deb1a
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerbaptiste committed Dec 18, 2020
2 parents 75deb1a + e4bf4d1 commit b061d30
Show file tree
Hide file tree
Showing 19 changed files with 277 additions and 218 deletions.
5 changes: 5 additions & 0 deletions behat.yml.dist
Expand Up @@ -11,6 +11,7 @@ default:
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand Down Expand Up @@ -45,6 +46,7 @@ postgres:
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand All @@ -64,6 +66,7 @@ mongodb:
- 'ApiPlatform\Core\Tests\Behat\HttpCacheContext'
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'
filters:
Expand Down Expand Up @@ -98,6 +101,7 @@ default-coverage:
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

Expand All @@ -117,6 +121,7 @@ mongodb-coverage:
- 'ApiPlatform\Core\Tests\Behat\JsonApiContext'
- 'ApiPlatform\Core\Tests\Behat\JsonHalContext'
- 'ApiPlatform\Core\Tests\Behat\CoverageContext'
- 'ApiPlatform\Core\Tests\Behat\XmlContext'
- 'Behat\MinkExtension\Context\MinkContext'
- 'behatch:context:rest'

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -21,7 +21,7 @@
"symfony/http-foundation": "^4.4 || ^5.1",
"symfony/http-kernel": "^4.4 || ^5.1",
"symfony/property-access": "^3.4.19 || ^4.4 || ^5.1",
"symfony/property-info": "^3.4 || ^4.4 || ^5.1",
"symfony/property-info": "^3.4 || ^4.4 || ^5.1@dev",
"symfony/serializer": "^4.4 || ^5.1",
"symfony/web-link": "^4.4 || ^5.1",
"willdurand/negotiation": "^2.0.3 || ^3.0"
Expand Down
45 changes: 22 additions & 23 deletions features/doctrine/search_filter.feature
Expand Up @@ -19,7 +19,7 @@ Feature: Search filter on collections
Given there is a DummyCar entity with related colors
When I send a "GET" request to "/dummy_cars?colors.prop=red"
Then the response status code should be 200
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"@context": "/contexts/DummyCar",
Expand Down Expand Up @@ -81,25 +81,25 @@ Feature: Search filter on collections
"hydra:mapping": [
{
"@type": "IriTemplateMapping",
"variable": "availableAt[after]",
"variable": "availableAt[before]",
"property": "availableAt",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "availableAt[before]",
"variable": "availableAt[strictly_before]",
"property": "availableAt",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "availableAt[strictly_after]",
"variable": "availableAt[after]",
"property": "availableAt",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "availableAt[strictly_before]",
"variable": "availableAt[strictly_after]",
"property": "availableAt",
"required": false
},
Expand All @@ -111,44 +111,38 @@ Feature: Search filter on collections
},
{
"@type": "IriTemplateMapping",
"variable": "colors",
"property": "colors",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "colors.prop",
"property": "colors.prop",
"variable": "foobar[]",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "colors[]",
"property": "colors",
"variable": "foobargroups[]",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "foobar[]",
"variable": "foobargroups_override[]",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "foobargroups[]",
"property": null,
"variable": "colors.prop",
"property": "colors.prop",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "foobargroups_override[]",
"property": null,
"variable": "colors",
"property": "colors",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "name",
"property": "name",
"variable": "colors[]",
"property": "colors",
"required": false
},
{
Expand Down Expand Up @@ -186,6 +180,12 @@ Feature: Search filter on collections
"variable": "uuid[]",
"property": "uuid",
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "name",
"property": "name",
"required": false
}
]
}
Expand Down Expand Up @@ -278,7 +278,6 @@ Feature: Search filter on collections
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 print last JSON response
And the JSON should be valid according to this schema:
"""
{
Expand Down
12 changes: 6 additions & 6 deletions features/graphql/introspection.feature
Expand Up @@ -71,7 +71,7 @@ Feature: GraphQL introspection support
And the response should be in JSON
And the header "Content-Type" should be equal to "application/json"
And the JSON node "data.type1.description" should be equal to "Dummy Product."
And the JSON node "data.type1.fields[1].type.name" should be equal to "DummyAggregateOfferConnection"
And the JSON node "data.type1.fields[2].type.name" should be equal to "DummyAggregateOfferConnection"
And the JSON node "data.type2.fields[0].name" should be equal to "edges"
And the JSON node "data.type2.fields[0].type.ofType.name" should be equal to "DummyAggregateOfferEdge"
And the JSON node "data.type3.fields[0].name" should be equal to "node"
Expand Down Expand Up @@ -201,7 +201,7 @@ Feature: GraphQL introspection support
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/json"
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -286,8 +286,8 @@ Feature: GraphQL introspection support
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/json"
And the JSON node "data.__type.fields[9].name" should be equal to "jsonData"
And the JSON node "data.__type.fields[9].type.name" should be equal to "Iterable"
And the JSON node "data.__type.fields[13].name" should be equal to "jsonData"
And the JSON node "data.__type.fields[13].type.name" should be equal to "Iterable"

Scenario: Retrieve entity - using serialization groups - fields
When I send the following GraphQL request:
Expand Down Expand Up @@ -424,8 +424,8 @@ Feature: GraphQL introspection support
And the JSON node "data.typeCreatePayload.fields[0].name" should be equal to "dummyProperty"
And the JSON node "data.typeCreatePayload.fields[0].type.name" should be equal to "createDummyPropertyPayloadData"
And the JSON node "data.typeCreatePayload.fields[1].name" should be equal to "clientMutationId"
And the JSON node "data.typeCreatePayloadData.fields[3].name" should be equal to "group"
And the JSON node "data.typeCreatePayloadData.fields[3].type.name" should be equal to "createDummyGroupNestedPayload"
And the JSON node "data.typeCreatePayloadData.fields[4].name" should be equal to "group"
And the JSON node "data.typeCreatePayloadData.fields[4].type.name" should be equal to "createDummyGroupNestedPayload"
And the JSON node "data.typeCreateNestedPayload.fields[0].name" should be equal to "id"

Scenario: Retrieve a type name through a GraphQL query
Expand Down
20 changes: 10 additions & 10 deletions features/jsonapi/related-resouces-inclusion.feature
Expand Up @@ -14,7 +14,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -56,7 +56,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -86,7 +86,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -123,7 +123,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -158,7 +158,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -238,7 +238,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -328,7 +328,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"data": {
Expand Down Expand Up @@ -398,7 +398,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"links": {
Expand Down Expand Up @@ -510,7 +510,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"links": {
Expand Down Expand Up @@ -602,7 +602,7 @@ Feature: JSON API Inclusion of Related Resources
Then the response status code should be 200
And the response should be in JSON
And the JSON should be valid according to the JSON API schema
And the JSON should be deep equal to:
And the JSON should be equal to:
"""
{
"links": {
Expand Down
2 changes: 1 addition & 1 deletion features/main/composite.feature
Expand Up @@ -11,7 +11,7 @@ Feature: Retrieve data with Composite identifiers
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 deep equal to:
And the JSON should be equal to:
"""
{
"@context": "/contexts/CompositeItem",
Expand Down
15 changes: 10 additions & 5 deletions features/main/content_negotiation.feature
Expand Up @@ -15,7 +15,8 @@ Feature: Content Negotiation support
"""
Then the response status code should be 201
And the header "Content-Type" should be equal to "application/xml; charset=utf-8"
And the response should be equal to
And the response should be in XML
And the XML should be equal to:
"""
<?xml version="1.0"?>
<response><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>1</id><name>XML!</name><alias/><foo/></response>
Expand All @@ -26,7 +27,8 @@ Feature: Content Negotiation support
And I send a "GET" request to "/dummies"
Then the response status code should be 200
And the header "Content-Type" should be equal to "application/xml; charset=utf-8"
And the response should be equal to
And the response should be in XML
And the XML should be equal to:
"""
<?xml version="1.0"?>
<response><item key="0"><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>1</id><name>XML!</name><alias/><foo/></item></response>
Expand All @@ -36,7 +38,8 @@ Feature: Content Negotiation support
When I send a "GET" request to "/dummies.xml"
Then the response status code should be 200
And the header "Content-Type" should be equal to "application/xml; charset=utf-8"
And the response should be equal to
And the response should be in XML
And the XML should be equal to:
"""
<?xml version="1.0"?>
<response><item key="0"><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>1</id><name>XML!</name><alias/><foo/></item></response>
Expand Down Expand Up @@ -82,7 +85,8 @@ Feature: Content Negotiation support
"""
Then the response status code should be 201
And the header "Content-Type" should be equal to "application/xml; charset=utf-8"
And the response should be equal to
And the response should be in XML
And the XML should be equal to:
"""
<?xml version="1.0"?>
<response><description/><dummy/><dummyBoolean/><dummyDate/><dummyFloat/><dummyPrice/><relatedDummy/><relatedDummies/><jsonData/><arrayData/><name_converted/><relatedOwnedDummy/><relatedOwningDummy/><id>2</id><name>Sent in JSON</name><alias/><foo/></response>
Expand Down Expand Up @@ -134,7 +138,8 @@ Feature: Content Negotiation support
"""
Then the response status code should be 201
And the header "Content-Type" should be equal to "application/xml; charset=utf-8"
And the response should be equal to
And the response should be in XML
And the XML should be equal to:
"""
<?xml version="1.0"?>
<response><id>1</id><name>Kevin</name></response>
Expand Down

0 comments on commit b061d30

Please sign in to comment.