Skip to content

Commit 917a0df

Browse files
test(hydra): tests changed because context json changed
1 parent 30f0566 commit 917a0df

File tree

2 files changed

+19
-47
lines changed

2 files changed

+19
-47
lines changed

features/hydra/docs.feature

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ Feature: Documentation support
2626
And the JSON node "@context[1].range.@type" should be equal to "@id"
2727
And the JSON node "@context[1].subClassOf.@id" should be equal to "rdfs:subClassOf"
2828
And the JSON node "@context[1].subClassOf.@type" should be equal to "@id"
29-
And the JSON node "@context[1].expects.@id" should be equal to "hydra:expects"
30-
And the JSON node "@context[1].expects.@type" should be equal to "@id"
31-
And the JSON node "@context[1].returns.@id" should be equal to "hydra:returns"
32-
And the JSON node "@context[1].returns.@type" should be equal to "@id"
3329
# Root properties
3430
And the JSON node "@id" should be equal to "/docs.jsonld"
3531
And the JSON node "hydra:title" should be equal to "My Dummy API"
@@ -80,7 +76,7 @@ Feature: Documentation support
8076
And the value of the node "hydra:method" of the operation "GET" of the Hydra class "Dummy" is "GET"
8177
And the value of the node "hydra:title" of the operation "GET" of the Hydra class "Dummy" is "Retrieves a Dummy resource."
8278
And the value of the node "rdfs:label" of the operation "GET" of the Hydra class "Dummy" is "Retrieves a Dummy resource."
83-
And the value of the node "returns" of the operation "GET" of the Hydra class "Dummy" is "#Dummy"
79+
And the value of the node "returns" of the operation "GET" of the Hydra class "Dummy" is "Dummy"
8480
And the value of the node "hydra:title" of the operation "PUT" of the Hydra class "Dummy" is "Replaces the Dummy resource."
8581
And the value of the node "hydra:title" of the operation "DELETE" of the Hydra class "Dummy" is "Deletes the Dummy resource."
8682
And the value of the node "returns" of the operation "DELETE" of the Hydra class "Dummy" is "owl:Nothing"

src/Hydra/Tests/Serializer/DocumentationNormalizerTest.php

Lines changed: 18 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ private function doTestNormalize($resourceMetadataFactory = null): void
127127
'@id' => 'rdfs:subClassOf',
128128
'@type' => '@id',
129129
],
130-
'expects' => [
131-
'@id' => 'hydra:expects',
132-
'@type' => '@id',
133-
],
134-
'returns' => [
135-
'@id' => 'hydra:returns',
136-
'@type' => '@id',
137-
],
138130
],
139131
],
140132
'@id' => '/doc',
@@ -229,23 +221,23 @@ private function doTestNormalize($resourceMetadataFactory = null): void
229221
'hydra:method' => 'GET',
230222
'hydra:title' => 'foobar',
231223
'rdfs:label' => 'foobar',
232-
'returns' => '#dummy',
224+
'returns' => 'dummy',
233225
'hydra:foo' => 'bar',
234226
],
235227
[
236228
'@type' => ['hydra:Operation', 'schema:ReplaceAction'],
237-
'expects' => '#dummy',
229+
'expects' => 'dummy',
238230
'hydra:method' => 'PUT',
239231
'hydra:title' => 'Replaces the dummy resource.',
240232
'rdfs:label' => 'Replaces the dummy resource.',
241-
'returns' => '#dummy',
233+
'returns' => 'dummy',
242234
],
243235
[
244236
'@type' => ['hydra:Operation', 'schema:FindAction'],
245237
'hydra:method' => 'GET',
246238
'hydra:title' => 'Retrieves a relatedDummy resource.',
247239
'rdfs:label' => 'Retrieves a relatedDummy resource.',
248-
'returns' => '#relatedDummy',
240+
'returns' => 'relatedDummy',
249241
],
250242
],
251243
],
@@ -280,11 +272,11 @@ private function doTestNormalize($resourceMetadataFactory = null): void
280272
],
281273
[
282274
'@type' => ['hydra:Operation', 'schema:CreateAction'],
283-
'expects' => '#dummy',
275+
'expects' => 'dummy',
284276
'hydra:method' => 'POST',
285277
'hydra:title' => 'Creates a dummy resource.',
286278
'rdfs:label' => 'Creates a dummy resource.',
287-
'returns' => '#dummy',
279+
'returns' => 'dummy',
288280
],
289281
],
290282
],
@@ -297,7 +289,7 @@ private function doTestNormalize($resourceMetadataFactory = null): void
297289
'@type' => 'hydra:Operation',
298290
'hydra:method' => 'GET',
299291
'rdfs:label' => 'The API entrypoint.',
300-
'returns' => '#EntryPoint',
292+
'returns' => 'EntryPoint',
301293
],
302294
],
303295
[
@@ -435,14 +427,6 @@ public function testNormalizeInputOutputClass(): void
435427
'@id' => 'rdfs:subClassOf',
436428
'@type' => '@id',
437429
],
438-
'expects' => [
439-
'@id' => 'hydra:expects',
440-
'@type' => '@id',
441-
],
442-
'returns' => [
443-
'@id' => 'hydra:returns',
444-
'@type' => '@id',
445-
],
446430
],
447431
],
448432
'@id' => '/doc',
@@ -527,7 +511,7 @@ public function testNormalizeInputOutputClass(): void
527511
'hydra:method' => 'GET',
528512
'hydra:title' => 'Retrieves a dummy resource.',
529513
'rdfs:label' => 'Retrieves a dummy resource.',
530-
'returns' => '#dummy',
514+
'returns' => 'dummy',
531515
],
532516
[
533517
'@type' => [
@@ -538,7 +522,7 @@ public function testNormalizeInputOutputClass(): void
538522
'hydra:method' => 'PUT',
539523
'hydra:title' => 'Replaces the dummy resource.',
540524
'rdfs:label' => 'Replaces the dummy resource.',
541-
'returns' => '#dummy',
525+
'returns' => 'dummy',
542526
],
543527
],
544528
'hydra:description' => 'dummy',
@@ -586,7 +570,7 @@ public function testNormalizeInputOutputClass(): void
586570
'hydra:Operation',
587571
'schema:CreateAction',
588572
],
589-
'expects' => '#dummy',
573+
'expects' => 'dummy',
590574
'hydra:method' => 'POST',
591575
'hydra:title' => 'Creates a dummy resource.',
592576
'rdfs:label' => 'Creates a dummy resource.',
@@ -603,7 +587,7 @@ public function testNormalizeInputOutputClass(): void
603587
'@type' => 'hydra:Operation',
604588
'hydra:method' => 'GET',
605589
'rdfs:label' => 'The API entrypoint.',
606-
'returns' => '#EntryPoint',
590+
'returns' => 'EntryPoint',
607591
],
608592
],
609593
2 => [
@@ -803,14 +787,6 @@ public function testNormalizeWithoutPrefix(): void
803787
'@id' => 'rdfs:subClassOf',
804788
'@type' => '@id',
805789
],
806-
'expects' => [
807-
'@id' => 'expects',
808-
'@type' => '@id',
809-
],
810-
'returns' => [
811-
'@id' => 'returns',
812-
'@type' => '@id',
813-
],
814790
],
815791
],
816792
'@id' => '/doc',
@@ -905,23 +881,23 @@ public function testNormalizeWithoutPrefix(): void
905881
'method' => 'GET',
906882
'title' => 'foobar',
907883
'rdfs:label' => 'foobar',
908-
'returns' => '#dummy',
884+
'returns' => 'dummy',
909885
'foo' => 'bar',
910886
],
911887
[
912888
'@type' => ['Operation', 'schema:ReplaceAction'],
913-
'expects' => '#dummy',
889+
'expects' => 'dummy',
914890
'method' => 'PUT',
915891
'title' => 'Replaces the dummy resource.',
916892
'rdfs:label' => 'Replaces the dummy resource.',
917-
'returns' => '#dummy',
893+
'returns' => 'dummy',
918894
],
919895
[
920896
'@type' => ['Operation', 'schema:FindAction'],
921897
'method' => 'GET',
922898
'title' => 'Retrieves a relatedDummy resource.',
923899
'rdfs:label' => 'Retrieves a relatedDummy resource.',
924-
'returns' => '#relatedDummy',
900+
'returns' => 'relatedDummy',
925901
],
926902
],
927903
],
@@ -956,11 +932,11 @@ public function testNormalizeWithoutPrefix(): void
956932
],
957933
[
958934
'@type' => ['Operation', 'schema:CreateAction'],
959-
'expects' => '#dummy',
935+
'expects' => 'dummy',
960936
'method' => 'POST',
961937
'title' => 'Creates a dummy resource.',
962938
'rdfs:label' => 'Creates a dummy resource.',
963-
'returns' => '#dummy',
939+
'returns' => 'dummy',
964940
],
965941
],
966942
],
@@ -973,7 +949,7 @@ public function testNormalizeWithoutPrefix(): void
973949
'@type' => 'Operation',
974950
'method' => 'GET',
975951
'rdfs:label' => 'The API entrypoint.',
976-
'returns' => '#EntryPoint',
952+
'returns' => 'EntryPoint',
977953
],
978954
],
979955
[

0 commit comments

Comments
 (0)