Skip to content

Commit eecfe29

Browse files
committed
fix exsistent tests
1 parent e8b415c commit eecfe29

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

features/openapi/docs.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Feature: Documentation support
153153
And the JSON node "paths./related_dummies/{id}/related_to_dummy_friends.get.parameters" should have 6 elements
154154

155155
# Subcollection - check schema
156-
And the JSON node "paths./related_dummies/{id}/related_to_dummy_friends.get.responses.200.content.application/ld+json.schema.properties.hydra:member.items.$ref" should be equal to "#/components/schemas/RelatedToDummyFriend.jsonld-fakemanytomany"
156+
And the JSON node "paths./related_dummies/{id}/related_to_dummy_friends.get.responses.200.content.application/ld+json.schema.properties.hydra:member.items.$ref" should be equal to "#/components/schemas/RelatedToDummyFriend.jsonld-fakemanytomany.output"
157157

158158
# Deprecations
159159
And the JSON node "paths./dummies.get.deprecated" should be false
@@ -165,8 +165,8 @@ Feature: Documentation support
165165
And the JSON node "paths./deprecated_resources/{id}.patch.deprecated" should be true
166166

167167
# Formats
168-
And the OpenAPI class "Dummy.jsonld" exists
169-
And the "@id" property exists for the OpenAPI class "Dummy.jsonld"
168+
And the OpenAPI class "Dummy.jsonld.output" exists
169+
And the "@id" property exists for the OpenAPI class "Dummy.jsonld.output"
170170
And the JSON node "paths./dummies.get.responses.200.content.application/ld+json" should be equal to:
171171
"""
172172
{
@@ -176,7 +176,7 @@ Feature: Documentation support
176176
"hydra:member": {
177177
"type": "array",
178178
"items": {
179-
"$ref": "#/components/schemas/Dummy.jsonld"
179+
"$ref": "#/components/schemas/Dummy.jsonld.output"
180180
}
181181
},
182182
"hydra:totalItems": {

tests/JsonSchema/Command/JsonSchemaGenerateCommandTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -103,24 +103,24 @@ public function testArraySchemaWithReference(): void
103103
$result = $this->tester->getDisplay();
104104
$json = json_decode($result, associative: true);
105105

106-
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write']['properties']['tests'], [
106+
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write.input']['properties']['tests'], [
107107
'type' => 'string',
108108
'foo' => 'bar',
109109
]);
110110

111-
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write']['properties']['nonResourceTests'], [
111+
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write.input']['properties']['nonResourceTests'], [
112112
'type' => 'array',
113113
'items' => [
114-
'$ref' => '#/definitions/NonResourceTestEntity.jsonld-write',
114+
'$ref' => '#/definitions/NonResourceTestEntity.jsonld-write.input',
115115
],
116116
]);
117117

118-
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write']['properties']['description'], [
118+
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write.input']['properties']['description'], [
119119
'maxLength' => 255,
120120
]);
121121

122-
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write']['properties']['type'], [
123-
'$ref' => '#/definitions/TestEntity.jsonld-write',
122+
$this->assertEquals($json['definitions']['BagOfTests.jsonld-write.input']['properties']['type'], [
123+
'$ref' => '#/definitions/TestEntity.jsonld-write.input',
124124
]);
125125
}
126126

@@ -130,14 +130,14 @@ public function testArraySchemaWithMultipleUnionTypesJsonLd(): void
130130
$result = $this->tester->getDisplay();
131131
$json = json_decode($result, associative: true);
132132

133-
$this->assertEquals($json['definitions']['Nest.jsonld']['properties']['owner']['anyOf'], [
134-
['$ref' => '#/definitions/Wren.jsonld'],
135-
['$ref' => '#/definitions/Robin.jsonld'],
133+
$this->assertEquals($json['definitions']['Nest.jsonld.output']['properties']['owner']['anyOf'], [
134+
['$ref' => '#/definitions/Wren.jsonld.output'],
135+
['$ref' => '#/definitions/Robin.jsonld.output'],
136136
['type' => 'null'],
137137
]);
138138

139-
$this->assertArrayHasKey('Wren.jsonld', $json['definitions']);
140-
$this->assertArrayHasKey('Robin.jsonld', $json['definitions']);
139+
$this->assertArrayHasKey('Wren.jsonld.output', $json['definitions']);
140+
$this->assertArrayHasKey('Robin.jsonld.output', $json['definitions']);
141141
}
142142

143143
public function testArraySchemaWithMultipleUnionTypesJsonApi(): void
@@ -183,7 +183,7 @@ public function testArraySchemaWithTypeFactory(): void
183183
$result = $this->tester->getDisplay();
184184
$json = json_decode($result, associative: true);
185185

186-
$this->assertEquals($json['definitions']['Foo.jsonld']['properties']['expiration'], ['type' => 'string', 'format' => 'date']);
186+
$this->assertEquals($json['definitions']['Foo.jsonld.output']['properties']['expiration'], ['type' => 'string', 'format' => 'date']);
187187
}
188188

189189
/**
@@ -195,7 +195,7 @@ public function testWritableNonResourceRef(): void
195195
$result = $this->tester->getDisplay();
196196
$json = json_decode($result, associative: true);
197197

198-
$this->assertEquals($json['definitions']['SaveProduct.jsonld']['properties']['codes']['items']['$ref'], '#/definitions/ProductCode.jsonld');
198+
$this->assertEquals($json['definitions']['SaveProduct.jsonld.input']['properties']['codes']['items']['$ref'], '#/definitions/ProductCode.jsonld.input');
199199
}
200200

201201
/**
@@ -207,8 +207,8 @@ public function testOpenApiResourceRefIsNotOverwritten(): void
207207
$result = $this->tester->getDisplay();
208208
$json = json_decode($result, associative: true);
209209

210-
$this->assertEquals('#/definitions/DummyFriend', $json['definitions']['Issue6299.Issue6299OutputDto.jsonld']['properties']['itemDto']['$ref']);
211-
$this->assertEquals('#/definitions/DummyDate', $json['definitions']['Issue6299.Issue6299OutputDto.jsonld']['properties']['collectionDto']['items']['$ref']);
210+
$this->assertEquals('#/definitions/DummyFriend', $json['definitions']['Issue6299.Issue6299OutputDto.jsonld.output']['properties']['itemDto']['$ref']);
211+
$this->assertEquals('#/definitions/DummyDate', $json['definitions']['Issue6299.Issue6299OutputDto.jsonld.output']['properties']['collectionDto']['items']['$ref']);
212212
}
213213

214214
/**
@@ -220,7 +220,7 @@ public function testSubSchemaJsonLd(): void
220220
$result = $this->tester->getDisplay();
221221
$json = json_decode($result, associative: true);
222222

223-
$this->assertArrayHasKey('@id', $json['definitions']['ThirdLevel.jsonld-friends']['properties']);
223+
$this->assertArrayHasKey('@id', $json['definitions']['ThirdLevel.jsonld-friends.output']['properties']);
224224
}
225225

226226
public function testJsonApiIncludesSchema(): void

0 commit comments

Comments
 (0)