Skip to content

Commit adaee45

Browse files
committed
Adjust so no hydra prefix in tests or by default
1 parent 0240235 commit adaee45

File tree

11 files changed

+51
-53
lines changed

11 files changed

+51
-53
lines changed

features/assets/schema/error.schema.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"default": {},
88
"required": [
99
"@type",
10-
"hydra:title",
11-
"hydra:description"
10+
"title",
11+
"description"
1212
],
1313
"additionalProperties": true,
1414
"properties": {
@@ -18,20 +18,20 @@
1818
"title": "The @type schema",
1919
"description": "An explanation about the purpose of this instance.",
2020
"default": "",
21-
"const": "hydra:Error"
21+
"const": "Error"
2222
},
23-
"hydra:title": {
24-
"$id": "#/properties/hydra:title",
23+
"title": {
24+
"$id": "#/properties/title",
2525
"type": "string",
26-
"title": "The hydra:title schema",
26+
"title": "The title schema",
2727
"description": "An explanation about the purpose of this instance.",
2828
"default": "",
2929
"const": "An error occurred"
3030
},
31-
"hydra:description": {
32-
"$id": "#/properties/hydra:description",
31+
"description": {
32+
"$id": "#/properties/description",
3333
"type": "string",
34-
"title": "The hydra:description schema",
34+
"title": "The description schema",
3535
"description": "An explanation about the purpose of this instance.",
3636
"default": "",
3737
"examples": [

features/assets/schema/validation_errors_object.schema.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
"default": "",
1717
"const": "ConstraintViolationList"
1818
},
19-
"hydra:title": {
20-
"$id": "#/properties/hydra:title",
19+
"title": {
20+
"$id": "#/properties/title",
2121
"type": "string",
22-
"title": "The Hydra:title Schema",
22+
"title": "The title Schema",
2323
"description": "An explanation about the purpose of this instance.",
2424
"default": "",
2525
"examples": [
2626
"An error occurred"
2727
]
2828
},
29-
"hydra:description": {
30-
"$id": "#/properties/hydra:description",
29+
"description": {
30+
"$id": "#/properties/description",
3131
"type": "string",
32-
"title": "The Hydra:description Schema",
32+
"title": "The description Schema",
3333
"description": "An explanation about the purpose of this instance.",
3434
"default": "",
3535
"examples": [

features/bootstrap/PublishableContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public function iCreateAResource(): void
251251
public function theResponseShouldIncludeTheDraftResourcesInsteadOfThePublishedOnes(): void
252252
{
253253
$response = $this->jsonContext->getJsonAsArray();
254-
$items = $response['hydra:member'];
254+
$items = $response['member'];
255255
$draftResources = array_filter(
256256
$this->resources,
257257
static function (DummyPublishableComponent $component) {
@@ -282,7 +282,7 @@ static function (DummyPublishableComponent $component) {
282282
public function theResponseShouldIncludeThePublishedResourcesOnly(): array
283283
{
284284
$response = $this->jsonContext->getJsonAsArray();
285-
$items = $response['hydra:member'];
285+
$items = $response['member'];
286286

287287
$publishedResources = array_filter(
288288
$this->resources,

features/collection/collection.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ Feature: A Collection component resource
5656
And there is a Collection resource
5757
When I send a "GET" request to the resource "collection"
5858
Then the response status code should be 200
59-
And the JSON node "collection.hydra:member" should have "30" elements
60-
And the JSON node "collection.hydra:totalItems" should be equal to "50"
59+
And the JSON node "collection.member" should have "30" elements
60+
And the JSON node "collection.totalItems" should be equal to "50"
6161
And the JSON node "collection.@id" should be equal to "/component/dummy_components"
62-
And the JSON node "collection.@type" should be equal to "hydra:Collection"
62+
And the JSON node "collection.@type" should be equal to "Collection"
6363

6464
@loginUser
6565
Scenario: I can get a collection component with perPage configured
@@ -72,14 +72,14 @@ Feature: A Collection component resource
7272
}
7373
"""
7474
Then the response status code should be 201
75-
And the JSON node "collection.hydra:member" should have "3" elements
75+
And the JSON node "collection.member" should have "3" elements
7676

7777
@loginUser
7878
Scenario Outline: Pagination parameter is configured
7979
Given there are 120 DummyResourceWithPagination resources
8080
When I send a "GET" request to "/dummy_resource_with_paginations<postfix>"
8181
Then the response status code should be 200
82-
And the JSON node "hydra:member" should have "<total>" elements
82+
And the JSON node "member" should have "<total>" elements
8383
Examples:
8484
| total | postfix |
8585
| 10 | |
@@ -94,7 +94,7 @@ Feature: A Collection component resource
9494
And there is a Collection resource with the resource IRI "/dummy_resource_with_paginations"
9595
When I send a "GET" request to the resource "collection" and the postfix "<postfix>"
9696
Then the response status code should be 200
97-
And the JSON node "collection.hydra:member" should have "<total>" elements
97+
And the JSON node "collection.member" should have "<total>" elements
9898
Examples:
9999
| total | postfix |
100100
| 10 | |
@@ -108,7 +108,7 @@ Feature: A Collection component resource
108108
Given there are 80 DummyResourceWithFilters resources
109109
When I send a "GET" request to "/dummy_resource_with_filters<postfix>"
110110
Then the response status code should be 200
111-
And the JSON node "hydra:member" should have "<total>" elements
111+
And the JSON node "member" should have "<total>" elements
112112
Examples:
113113
| total | postfix |
114114
| 17 | ?reference=1 |
@@ -124,7 +124,7 @@ Feature: A Collection component resource
124124
And there is a Collection resource with the resource IRI "/dummy_resource_with_filters" and default query string parameters
125125
When I send a "GET" request to the resource "collection" and the postfix "<postfix>"
126126
Then the response status code should be 200
127-
And the JSON node "collection.hydra:member" should have "<total>" elements
127+
And the JSON node "collection.member" should have "<total>" elements
128128
Examples:
129129
| total | postfix |
130130
| 17 | |

features/form/form.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Feature: Form component that defines a form type created in the application
113113
And the JSON should be a superset of:
114114
"""
115115
{
116-
"hydra:description": "Form object key could not be found. Expected: <b>test</b>: { \"input_name\": \"input_value\" }"
116+
"description": "Form object key could not be found. Expected: <b>test</b>: { \"input_name\": \"input_value\" }"
117117
}
118118
"""
119119

features/main/layout.feature

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,61 +51,61 @@ Feature: Layout resources
5151
And there is a Layout with the reference "secondary"
5252
When I send a "GET" request to "/_/layouts"
5353
Then the response status code should be 200
54-
And the JSON node "hydra:member" should have "2" elements
54+
And the JSON node "member" should have "2" elements
5555

5656
@loginUser
5757
Scenario: The layout resources can be filtered by reference
5858
Given there is a Layout with the reference "primary"
5959
And there is a Layout with the reference "secondary"
6060
When I send a "GET" request to "/_/layouts?reference=primary"
6161
Then the response status code should be 200
62-
And the JSON node "hydra:member" should have "1" element
62+
And the JSON node "member" should have "1" element
6363

6464
@loginUser
6565
Scenario: The layout resources can be ordered ascending by reference
6666
Given there is a Layout with the reference "1"
6767
And there is a Layout with the reference "2"
6868
When I send a "GET" request to "/_/layouts?order[reference]=asc"
6969
Then the response status code should be 200
70-
And the JSON node "hydra:member" should have "2" elements
71-
And the JSON node "hydra:member[0].reference" should be equal to "1"
72-
And the JSON node "hydra:member[1].reference" should be equal to "2"
70+
And the JSON node "member" should have "2" elements
71+
And the JSON node "member[0].reference" should be equal to "1"
72+
And the JSON node "member[1].reference" should be equal to "2"
7373

7474
@loginUser
7575
Scenario: The layout resources can be ordered descending by reference
7676
Given there is a Layout with the reference "1"
7777
And there is a Layout with the reference "2"
7878
When I send a "GET" request to "/_/layouts?order[reference]=desc"
7979
Then the response status code should be 200
80-
And the JSON node "hydra:member" should have "2" elements
81-
And the JSON node "hydra:member[0].reference" should be equal to "2"
82-
And the JSON node "hydra:member[1].reference" should be equal to "1"
80+
And the JSON node "member" should have "2" elements
81+
And the JSON node "member[0].reference" should be equal to "2"
82+
And the JSON node "member[1].reference" should be equal to "1"
8383

8484
@loginUser
8585
Scenario: The layout resources can be ordered ascending by createdAt
8686
Given there is a Layout with the reference "layout_1" and with createdAt "now"
8787
And there is a Layout with the reference "layout_2" and with createdAt "+10 seconds"
8888
When I send a "GET" request to "/_/layouts?order[createdAt]=asc"
8989
Then the response status code should be 200
90-
And the JSON node "hydra:member" should have "2" elements
91-
And the JSON node "hydra:member[0].reference" should be equal to "layout_1"
92-
And the JSON node "hydra:member[1].reference" should be equal to "layout_2"
90+
And the JSON node "member" should have "2" elements
91+
And the JSON node "member[0].reference" should be equal to "layout_1"
92+
And the JSON node "member[1].reference" should be equal to "layout_2"
9393

9494
@loginUser
9595
Scenario: The layout resources can be ordered descending by createdAt
9696
Given there is a Layout with the reference "layout_1" and with createdAt "now"
9797
And there is a Layout with the reference "layout_2" and with createdAt "+10 seconds"
9898
When I send a "GET" request to "/_/layouts?order[createdAt]=desc"
9999
Then the response status code should be 200
100-
And the JSON node "hydra:member" should have "2" elements
101-
And the JSON node "hydra:member[0].reference" should be equal to "layout_2"
102-
And the JSON node "hydra:member[1].reference" should be equal to "layout_1"
100+
And the JSON node "member" should have "2" elements
101+
And the JSON node "member[0].reference" should be equal to "layout_2"
102+
And the JSON node "member[1].reference" should be equal to "layout_1"
103103

104104
@loginUser
105105
Scenario: The layout resources can be filtered by ui components
106106
Given there is a Layout with the reference "primary" and with the uiComponent "PrimaryLayout"
107107
And there is a Layout with the reference "secondary" and with the uiComponent "SecondaryLayout"
108108
When I send a "GET" request to "/_/layouts?uiComponent=PrimaryLayout"
109109
Then the response status code should be 200
110-
And the JSON node "hydra:member" should have "1" elements
111-
And the JSON node "hydra:member[0].reference" should be equal to "primary"
110+
And the JSON node "member" should have "1" elements
111+
And the JSON node "member[0].reference" should be equal to "primary"

features/main/page.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Feature: Page resources
4646
| <layout> | <reference> | <nested> | false |
4747
Then the response status code should be 500
4848
And the JSON should be valid according to the schema file "error.schema.json"
49-
And the JSON node "hydra:description" should be equal to the string '<message>'
49+
And the JSON node "description" should be equal to the string '<message>'
5050
Examples:
5151
| layout | reference | nested | message |
5252
| resource[layout] | home | null | The type of the "nested" attribute must be "bool", "NULL" given. |

features/main/page_data_metadata.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Feature: Page data metadata
1111
When I send a "GET" request to "/_/page_data_metadatas"
1212
Then the response status code should be 200
1313
And the JSON node "@context.properties" should be equal to "PageDataMetadata/properties"
14-
And the JSON node "hydra:member" should have 4 elements
14+
And the JSON node "member" should have 4 elements
1515
# the order is not consistent... and doesn't really need to be - if no cache vs if cached
16-
# And the JSON node "hydra:member[0].properties" should have 0 element
17-
# And the JSON node "hydra:member[1].properties" should have 1 element
18-
# And the JSON node "hydra:member[1].properties[0].property" should be equal to "component"
19-
# And the JSON node "hydra:member[1].properties[0].componentClass" should be equal to "DummyComponent"
16+
# And the JSON node "member[0].properties" should have 0 element
17+
# And the JSON node "member[1].properties" should have 1 element
18+
# And the JSON node "member[1].properties[0].property" should be equal to "component"
19+
# And the JSON node "member[1].properties[0].componentClass" should be equal to "DummyComponent"
2020

2121
Scenario: I can get a single page data endpoint
2222
When I send a "GET" request to "/_/page_data_metadatas/Silverback%5CApiComponentsBundle%5CTests%5CFunctional%5CTestBundle%5CEntity%5CPageDataWithComponent"

features/main/security.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Feature: Restrict loading of components and routes
2626
Given there is a Route "/user-area/my-page" with a page
2727
When I send a "GET" request to "/_/routes"
2828
Then the response status code should be 200
29-
And the JSON node "hydra:member[0]" should not exist
29+
And the JSON node "member[0]" should not exist
3030

3131
@loginSuperAdmin
3232
Scenario: I can get a collection of routes as a super admin
3333
Given there is a Route "/user-area/my-page" with a page
3434
When I send a "GET" request to "/_/routes"
3535
Then the response status code should be 200
36-
And the JSON node "hydra:member[0]" should exist
36+
And the JSON node "member[0]" should exist
3737

3838
Scenario: A component in a restricted route cannot be loaded by an anonymous user
3939
Given there is a component in a route with the path "/user-area/my-page"

features/user/new_email_address.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Feature: Register process via a form
4646
}
4747
"""
4848
Then the response status code should be 400
49-
And the JSON node "hydra:description" should be equal to "<expectedMessage>"
49+
And the JSON node "description" should be equal to "<expectedMessage>"
5050
And I should not receive any emails
5151
Examples:
5252
| headerName | headerValue | expectedMessage |

0 commit comments

Comments
 (0)