Skip to content

Commit bb2f438

Browse files
committed
fix Behat
1 parent 9bf6d71 commit bb2f438

File tree

7 files changed

+197
-70
lines changed

7 files changed

+197
-70
lines changed

features/hydra/item_uri_template.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Feature: Exposing a collection of objects should use the specified operation to
9999
"@context": {"pattern": "^/contexts/Car$"},
100100
"@id": {"pattern": "^/cars/.+$"},
101101
"@type": {"pattern": "^Car$"},
102+
"operation": {"type": "array"},
102103
"id": {"type": "string"},
103104
"owner": {"type": "string"}
104105
}
@@ -126,6 +127,7 @@ Feature: Exposing a collection of objects should use the specified operation to
126127
"@context": {"pattern": "^/contexts/Car$"},
127128
"@id": {"pattern": "^/brands/renault/cars/.+$"},
128129
"@type": {"pattern": "^Car$"},
130+
"operation": {"type": "array"},
129131
"id": {"type": "string"},
130132
"owner": {"type": "string"}
131133
}

features/main/custom_identifier.feature

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,56 @@ Feature: Using custom identifier on resource
2121
"@context": "/contexts/CustomIdentifierDummy",
2222
"@id": "/custom_identifier_dummies/1",
2323
"@type": "CustomIdentifierDummy",
24+
"operation": [
25+
{
26+
"@type": [
27+
"hydra:Operation",
28+
"schema:FindAction"
29+
],
30+
"hydra:description": "Retrieves a CustomIdentifierDummy resource.",
31+
"hydra:method": "GET",
32+
"hydra:title": "getCustomIdentifierDummy",
33+
"returns": "CustomIdentifierDummy"
34+
},
35+
{
36+
"@type": [
37+
"hydra:Operation",
38+
"schema:ReplaceAction"
39+
],
40+
"expects": "CustomIdentifierDummy",
41+
"hydra:description": "Replaces the CustomIdentifierDummy resource.",
42+
"hydra:method": "PUT",
43+
"hydra:title": "putCustomIdentifierDummy",
44+
"returns": "CustomIdentifierDummy"
45+
},
46+
{
47+
"@type": "hydra:Operation",
48+
"expects": "CustomIdentifierDummy",
49+
"expectsHeader": [
50+
{
51+
"headerName": "Content-Type",
52+
"possibleValue": [
53+
"application/merge-patch+json",
54+
"application/vnd.api+json"
55+
]
56+
}
57+
],
58+
"hydra:description": "Updates the CustomIdentifierDummy resource.",
59+
"hydra:method": "PATCH",
60+
"hydra:title": "patchCustomIdentifierDummy",
61+
"returns": "CustomIdentifierDummy"
62+
},
63+
{
64+
"@type": [
65+
"hydra:Operation",
66+
"schema:DeleteAction"
67+
],
68+
"hydra:description": "Deletes the CustomIdentifierDummy resource.",
69+
"hydra:method": "DELETE",
70+
"hydra:title": "deleteCustomIdentifierDummy",
71+
"returns": "owl:Nothing"
72+
}
73+
],
2474
"customId": 1,
2575
"name": "My Dummy"
2676
}

features/main/relation.feature

Lines changed: 107 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Feature: Relations support
161161
"""
162162
{
163163
"@context": "/contexts/RelatedDummy",
164-
"@id": "/related_dummies/1",
164+
"@id": "/related_dummies/2",
165165
"@type": "https://schema.org/Product",
166166
"operation": [
167167
{
@@ -717,7 +717,7 @@ Feature: Relations support
717717
"""
718718
{
719719
"@context": "/contexts/RelationEmbedder",
720-
"@id": "/relation_embedders/1",
720+
"@id": "/relation_embedders/2",
721721
"@type": "RelationEmbedder",
722722
"operation": [
723723
{
@@ -913,61 +913,57 @@ Feature: Relations support
913913
"""
914914
{
915915
"@context": "/contexts/RelationEmbedder",
916-
"@id": "/relation_embedders/2",
916+
"@id": "/relation_embedders/1",
917917
"@type": "RelationEmbedder",
918918
"operation": [
919919
{
920-
"@type": [
921-
"hydra:Operation",
922-
"schema:FindAction"
923-
],
920+
"@type": "hydra:Operation",
924921
"hydra:description": "Retrieves a RelationEmbedder resource.",
925922
"hydra:method": "GET",
926-
"hydra:title": "getRelationEmbedder",
927-
"returns": "RelationEmbedder"
923+
"hydra:title": "A custom operation",
924+
"returns": "xsd:string"
928925
},
929926
{
930-
"@type": [
931-
"hydra:Operation",
932-
"schema:ReplaceAction"
933-
],
927+
"@type": "hydra:Operation",
934928
"expects": "RelationEmbedder",
935929
"hydra:description": "Replaces the RelationEmbedder resource.",
936930
"hydra:method": "PUT",
937-
"hydra:title": "putRelationEmbedder",
938-
"returns": "RelationEmbedder"
931+
"hydra:title": "A custom operation",
932+
"returns": "xsd:string"
939933
},
940934
{
941935
"@type": "hydra:Operation",
942-
"expects": "RelationEmbedder",
943-
"expectsHeader": [
944-
{
945-
"headerName": "Content-Type",
946-
"possibleValue": [
947-
"application/merge-patch+json",
948-
"application/vnd.api+json"
949-
]
950-
}
951-
],
952-
"hydra:description": "Updates the RelationEmbedder resource.",
953-
"hydra:method": "PATCH",
954-
"hydra:title": "patchRelationEmbedder",
955-
"returns": "RelationEmbedder"
956-
},
957-
{
958-
"@type": [
959-
"hydra:Operation",
960-
"schema:DeleteAction"
961-
],
962936
"hydra:description": "Deletes the RelationEmbedder resource.",
963937
"hydra:method": "DELETE",
964-
"hydra:title": "deleteRelationEmbedder",
965-
"returns": "owl:Nothing"
938+
"hydra:title": "A custom operation",
939+
"returns": "xsd:string"
940+
},
941+
{
942+
"@type": "hydra:Operation",
943+
"hydra:description": "Retrieves a RelationEmbedder resource.",
944+
"hydra:method": "GET",
945+
"hydra:title": "A custom operation",
946+
"returns": "xsd:string"
947+
},
948+
{
949+
"@type": "hydra:Operation",
950+
"hydra:description": "Retrieves a RelationEmbedder resource.",
951+
"hydra:method": "GET",
952+
"hydra:title": "A custom operation",
953+
"returns": "xsd:string"
954+
},
955+
{
956+
"@type": "hydra:Operation",
957+
"expects": "RelationEmbedder",
958+
"hydra:description": "Replaces the RelationEmbedder resource.",
959+
"hydra:method": "PUT",
960+
"hydra:title": "A custom operation",
961+
"returns": "xsd:string"
966962
}
967963
],
968964
"krondstadt": "Krondstadt",
969965
"anotherRelated": {
970-
"@id": "/related_dummies/2",
966+
"@id": "/related_dummies/1",
971967
"@type": "https://schema.org/Product",
972968
"operation": [
973969
{
@@ -1035,7 +1031,7 @@ Feature: Relations support
10351031

10361032
Scenario: Update the relation with a new one
10371033
When I add "Content-Type" header equal to "application/ld+json"
1038-
And I send a "PUT" request to "/relation_embedders/2" with body:
1034+
And I send a "PUT" request to "/relation_embedders/1" with body:
10391035
"""
10401036
{
10411037
"anotherRelated": {
@@ -1054,33 +1050,50 @@ Feature: Relations support
10541050
"@type": "RelationEmbedder",
10551051
"operation": [
10561052
{
1057-
"@type": [
1058-
"hydra:Operation",
1059-
"schema:FindAction"
1060-
],
1053+
"@type": "hydra:Operation",
10611054
"hydra:description": "Retrieves a RelationEmbedder resource.",
10621055
"hydra:method": "GET",
1063-
"hydra:title": "getRelationEmbedder",
1064-
"returns": "RelationEmbedder"
1056+
"hydra:title": "A custom operation",
1057+
"returns": "xsd:string"
10651058
},
10661059
{
1067-
"@type": [
1068-
"hydra:Operation",
1069-
"schema:ReplaceAction"
1070-
],
1060+
"@type": "hydra:Operation",
10711061
"expects": "RelationEmbedder",
10721062
"hydra:description": "Replaces the RelationEmbedder resource.",
10731063
"hydra:method": "PUT",
1074-
"hydra:title": "putRelationEmbedder",
1075-
"returns": "RelationEmbedder"
1064+
"hydra:title": "A custom operation",
1065+
"returns": "xsd:string"
1066+
},
1067+
{
1068+
"@type": "hydra:Operation",
1069+
"hydra:description": "Deletes the RelationEmbedder resource.",
1070+
"hydra:method": "DELETE",
1071+
"hydra:title": "A custom operation",
1072+
"returns": "xsd:string"
1073+
},
1074+
{
1075+
"@type": "hydra:Operation",
1076+
"hydra:description": "Retrieves a RelationEmbedder resource.",
1077+
"hydra:method": "GET",
1078+
"hydra:title": "A custom operation",
1079+
"returns": "xsd:string"
1080+
},
1081+
{
1082+
"@type": "hydra:Operation",
1083+
"hydra:description": "Retrieves a RelationEmbedder resource.",
1084+
"hydra:method": "GET",
1085+
"hydra:title": "A custom operation",
1086+
"returns": "xsd:string"
10761087
},
10771088
{
10781089
"@type": "hydra:Operation",
10791090
"expects": "RelationEmbedder",
1080-
"expectsHeader": [
1081-
{
1082-
"headerName": "Content-Type",
1083-
"possibleValue": [
1091+
"hydra:description": "Replaces the RelationEmbedder resource.",
1092+
"hydra:method": "PUT",
1093+
"hydra:title": "A custom operation",
1094+
"returns": "xsd:string"
1095+
}
1096+
],
10841097
"application/merge-patch+json",
10851098
"application/vnd.api+json"
10861099
]
@@ -1263,6 +1276,45 @@ Feature: Relations support
12631276
"hydra:title": "A custom operation",
12641277
"returns": "xsd:string"
12651278
}
1279+
],
1280+
},
1281+
{
1282+
"@type": "hydra:Operation",
1283+
"expects": "RelationEmbedder",
1284+
"hydra:description": "Replaces the RelationEmbedder resource.",
1285+
"hydra:method": "PUT",
1286+
"hydra:title": "A custom operation",
1287+
"returns": "xsd:string"
1288+
},
1289+
{
1290+
"@type": "hydra:Operation",
1291+
"hydra:description": "Deletes the RelationEmbedder resource.",
1292+
"hydra:method": "DELETE",
1293+
"hydra:title": "A custom operation",
1294+
"returns": "xsd:string"
1295+
},
1296+
{
1297+
"@type": "hydra:Operation",
1298+
"hydra:description": "Retrieves a RelationEmbedder resource.",
1299+
"hydra:method": "GET",
1300+
"hydra:title": "A custom operation",
1301+
"returns": "xsd:string"
1302+
},
1303+
{
1304+
"@type": "hydra:Operation",
1305+
"hydra:description": "Retrieves a RelationEmbedder resource.",
1306+
"hydra:method": "GET",
1307+
"hydra:title": "A custom operation",
1308+
"returns": "xsd:string"
1309+
},
1310+
{
1311+
"@type": "hydra:Operation",
1312+
"expects": "RelationEmbedder",
1313+
"hydra:description": "Replaces the RelationEmbedder resource.",
1314+
"hydra:method": "PUT",
1315+
"hydra:title": "A custom operation",
1316+
"returns": "xsd:string"
1317+
}
12661318
],
12671319
"krondstadt": "Krondstadt",
12681320
"anotherRelated": {

features/main/sub_resource.feature

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -678,25 +678,22 @@ Feature: Sub-resource support
678678
"@context": "/contexts/DummyProduct",
679679
"@id": "/dummy_products/2",
680680
"@type": "DummyProduct",
681-
"offers": [
682-
"/dummy_aggregate_offers/1"
683-
],
684-
"id": 2,
685-
"name": "Dummy product",
686-
"relatedProducts": [
687-
"/dummy_products/1"
688-
],
689-
"parent": null,
690681
"operation": [
691682
{
692-
"@type": ["hydra:Operation", "schema:FindAction"],
683+
"@type": [
684+
"hydra:Operation",
685+
"schema:FindAction"
686+
],
693687
"hydra:description": "Retrieves a DummyProduct resource.",
694688
"hydra:method": "GET",
695689
"hydra:title": "getDummyProduct",
696690
"returns": "DummyProduct"
697691
},
698692
{
699-
"@type": ["hydra:Operation", "schema:ReplaceAction"],
693+
"@type": [
694+
"hydra:Operation",
695+
"schema:ReplaceAction"
696+
],
700697
"expects": "DummyProduct",
701698
"hydra:description": "Replaces the DummyProduct resource.",
702699
"hydra:method": "PUT",
@@ -709,7 +706,10 @@ Feature: Sub-resource support
709706
"expectsHeader": [
710707
{
711708
"headerName": "Content-Type",
712-
"possibleValue": ["application/merge-patch+json"]
709+
"possibleValue": [
710+
"application/merge-patch+json",
711+
"application/vnd.api+json"
712+
]
713713
}
714714
],
715715
"hydra:description": "Updates the DummyProduct resource.",
@@ -718,13 +718,25 @@ Feature: Sub-resource support
718718
"returns": "DummyProduct"
719719
},
720720
{
721-
"@type": ["hydra:Operation", "schema:DeleteAction"],
721+
"@type": [
722+
"hydra:Operation",
723+
"schema:DeleteAction"
724+
],
722725
"hydra:description": "Deletes the DummyProduct resource.",
723726
"hydra:method": "DELETE",
724727
"hydra:title": "deleteDummyProduct",
725-
"returns": "DummyProduct"
728+
"returns": "owl:Nothing"
726729
}
727-
]
730+
],
731+
"id": 2,
732+
"offers": [
733+
"/dummy_aggregate_offers/1"
734+
],
735+
"name": "Dummy product",
736+
"relatedProducts": [
737+
"/dummy_products/1"
738+
],
739+
"parent": null
728740
}
729741
"""
730742

features/main/table_inheritance.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ Feature: Table inheritance
544544
"type": "string",
545545
"pattern": "^ResourceInterface$"
546546
},
547+
"operation": {"type": "array"},
547548
"foo": {
548549
"type": "string",
549550
"pattern": "^single item$"

0 commit comments

Comments
 (0)