@@ -262,16 +262,14 @@ Feature: Relations support
262262 "@id": "/relation_embedders/1",
263263 "@type": "RelationEmbedder",
264264 "krondstadt": "Krondstadt",
265- "anotherRelated": null,
266265 "related": {
267266 "@id": "/related_dummies/1",
268267 "@type": "https://schema.org/Product",
269268 "symfony": "symfony",
270269 "thirdLevel": {
271270 "@id": "/third_levels/1",
272271 "@type": "ThirdLevel",
273- "level": 3,
274- "fourthLevel": null
272+ "level": 3
275273 }
276274 }
277275 }
@@ -300,10 +298,8 @@ Feature: Relations support
300298 "anotherRelated": {
301299 "@id": "/related_dummies/2",
302300 "@type": "https://schema.org/Product",
303- "symfony": "laravel",
304- "thirdLevel": null
305- },
306- "related": null
301+ "symfony": "laravel"
302+ }
307303 }
308304 """
309305
@@ -330,10 +326,8 @@ Feature: Relations support
330326 "anotherRelated": {
331327 "@id": "/related_dummies/3",
332328 "@type": "https://schema.org/Product",
333- "symfony": "laravel2",
334- "thirdLevel": null
335- },
336- "related": null
329+ "symfony": "laravel2"
330+ }
337331 }
338332 """
339333
@@ -389,10 +383,8 @@ Feature: Relations support
389383 "anotherRelated": {
390384 "@id": "/related_dummies/2",
391385 "@type": "https://schema.org/Product",
392- "symfony": "API Platform",
393- "thirdLevel": null
394- },
395- "related": null
386+ "symfony": "API Platform"
387+ }
396388 }
397389 """
398390
@@ -545,3 +537,58 @@ Feature: Relations support
545537 ]
546538 }
547539 """
540+
541+ @createSchema
542+ Scenario : Patch the relation
543+ When I add "Content-Type" header equal to "application/ld+json"
544+ And I send a "POST" request to "/relation_embedders" with body:
545+ """
546+ {
547+ "anotherRelated": {
548+ "symfony": "laravel"
549+ }
550+ }
551+ """
552+ Then the response status code should be 201
553+ And the response should be in JSON
554+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
555+ And the JSON should be equal to:
556+ """
557+ {
558+ "@context": "/contexts/RelationEmbedder",
559+ "@id": "/relation_embedders/1",
560+ "@type": "RelationEmbedder",
561+ "krondstadt": "Krondstadt",
562+ "anotherRelated": {
563+ "@id": "/related_dummies/1",
564+ "@type": "https://schema.org/Product",
565+ "symfony": "laravel"
566+ }
567+ }
568+ """
569+ Then I add "Content-Type" header equal to "application/merge-patch+json"
570+ And I send a "PATCH" request to "/relation_embedders/1" with body:
571+ """
572+ {
573+ "anotherRelated": {
574+ "symfony": "laravel2"
575+ }
576+ }
577+ """
578+ Then the response status code should be 200
579+ And the response should be in JSON
580+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
581+ And the JSON should be equal to:
582+ """
583+ {
584+ "@context": "/contexts/RelationEmbedder",
585+ "@id": "/relation_embedders/1",
586+ "@type": "RelationEmbedder",
587+ "krondstadt": "Krondstadt",
588+ "anotherRelated": {
589+ "@id": "/related_dummies/1",
590+ "@type": "https://schema.org/Product",
591+ "symfony": "laravel2"
592+ }
593+ }
594+ """
0 commit comments