Skip to content

Commit 9bb354a

Browse files
committed
fix tests
1 parent 3c4d54a commit 9bb354a

4 files changed

Lines changed: 141 additions & 0 deletions

File tree

tests/Functional/BackedEnumResourceTest.php

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,15 @@ public static function providerEnumItemsJson(): iterable
6969
'@context' => '/contexts/Availability',
7070
'@id' => '/availabilities/'.$case->value,
7171
'@type' => 'Availability',
72+
'operation' => [
73+
[
74+
'@type' => ['hydra:Operation', 'schema:FindAction'],
75+
'hydra:method' => 'GET',
76+
'hydra:title' => 'getAvailability',
77+
'hydra:description' => 'Retrieves a Availability resource.',
78+
'returns' => 'Availability',
79+
],
80+
],
7281
'value' => $case->value,
7382
]];
7483
}
@@ -100,6 +109,15 @@ public static function providerEnumItemsJson(): iterable
100109
'@context' => '/contexts/AvailabilityStatus',
101110
'@id' => '/availability_statuses/'.$case->value,
102111
'@type' => 'AvailabilityStatus',
112+
'operation' => [
113+
[
114+
'@type' => ['hydra:Operation', 'schema:FindAction'],
115+
'hydra:method' => 'GET',
116+
'hydra:title' => 'getAvailabilityStatus',
117+
'hydra:description' => 'Retrieves a AvailabilityStatus resource.',
118+
'returns' => 'AvailabilityStatus',
119+
],
120+
],
103121
'value' => $case->value,
104122
]];
105123
}
@@ -220,16 +238,43 @@ public function testCollectionJsonLd(): void
220238
[
221239
'@id' => '/availabilities/0',
222240
'@type' => 'Availability',
241+
'operation' => [
242+
[
243+
'@type' => ['hydra:Operation', 'schema:FindAction'],
244+
'hydra:method' => 'GET',
245+
'hydra:title' => 'getAvailability',
246+
'hydra:description' => 'Retrieves a Availability resource.',
247+
'returns' => 'Availability',
248+
],
249+
],
223250
'value' => 0,
224251
],
225252
[
226253
'@id' => '/availabilities/10',
227254
'@type' => 'Availability',
255+
'operation' => [
256+
[
257+
'@type' => ['hydra:Operation', 'schema:FindAction'],
258+
'hydra:method' => 'GET',
259+
'hydra:title' => 'getAvailability',
260+
'hydra:description' => 'Retrieves a Availability resource.',
261+
'returns' => 'Availability',
262+
],
263+
],
228264
'value' => 10,
229265
],
230266
[
231267
'@id' => '/availabilities/200',
232268
'@type' => 'Availability',
269+
'operation' => [
270+
[
271+
'@type' => ['hydra:Operation', 'schema:FindAction'],
272+
'hydra:method' => 'GET',
273+
'hydra:title' => 'getAvailability',
274+
'hydra:description' => 'Retrieves a Availability resource.',
275+
'returns' => 'Availability',
276+
],
277+
],
233278
'value' => 200,
234279
],
235280
],
@@ -337,20 +382,47 @@ public static function providerCollection(): iterable
337382
[
338383
'@id' => '/backed_enum_integer_resources/1',
339384
'@type' => 'BackedEnumIntegerResource',
385+
'operation' => [
386+
[
387+
'@type' => ['hydra:Operation', 'schema:FindAction'],
388+
'hydra:method' => 'GET',
389+
'hydra:title' => 'getBackedEnumIntegerResource',
390+
'hydra:description' => 'Retrieves a BackedEnumIntegerResource resource.',
391+
'returns' => 'BackedEnumIntegerResource',
392+
],
393+
],
340394
'name' => 'Yes',
341395
'value' => 1,
342396
'description' => 'We say yes',
343397
],
344398
[
345399
'@id' => '/backed_enum_integer_resources/2',
346400
'@type' => 'BackedEnumIntegerResource',
401+
'operation' => [
402+
[
403+
'@type' => ['hydra:Operation', 'schema:FindAction'],
404+
'hydra:method' => 'GET',
405+
'hydra:title' => 'getBackedEnumIntegerResource',
406+
'hydra:description' => 'Retrieves a BackedEnumIntegerResource resource.',
407+
'returns' => 'BackedEnumIntegerResource',
408+
],
409+
],
347410
'name' => 'No',
348411
'value' => 2,
349412
'description' => 'Computer says no',
350413
],
351414
[
352415
'@id' => '/backed_enum_integer_resources/3',
353416
'@type' => 'BackedEnumIntegerResource',
417+
'operation' => [
418+
[
419+
'@type' => ['hydra:Operation', 'schema:FindAction'],
420+
'hydra:method' => 'GET',
421+
'hydra:title' => 'getBackedEnumIntegerResource',
422+
'hydra:description' => 'Retrieves a BackedEnumIntegerResource resource.',
423+
'returns' => 'BackedEnumIntegerResource',
424+
],
425+
],
354426
'name' => 'Maybe',
355427
'value' => 3,
356428
'description' => 'Let me think about it',
@@ -457,6 +529,15 @@ public static function providerItem(): iterable
457529
'@context' => '/contexts/BackedEnumIntegerResource',
458530
'@id' => '/backed_enum_integer_resources/1',
459531
'@type' => 'BackedEnumIntegerResource',
532+
'operation' => [
533+
[
534+
'@type' => ['hydra:Operation', 'schema:FindAction'],
535+
'hydra:method' => 'GET',
536+
'hydra:title' => 'getBackedEnumIntegerResource',
537+
'hydra:description' => 'Retrieves a BackedEnumIntegerResource resource.',
538+
'returns' => 'BackedEnumIntegerResource',
539+
],
540+
],
460541
'name' => 'Yes',
461542
'value' => 1,
462543
'description' => 'We say yes',

tests/Functional/MathNumberTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ public function testGetMathNumber(): void
5454
'@context' => '/contexts/MathNumber',
5555
'@id' => '/math_numbers/1',
5656
'@type' => 'MathNumber',
57+
'operation' => [
58+
[
59+
'@type' => ['hydra:Operation', 'schema:FindAction'],
60+
'hydra:method' => 'GET',
61+
'hydra:title' => 'getMathNumber',
62+
'hydra:description' => 'Retrieves a MathNumber resource.',
63+
'returns' => 'MathNumber',
64+
],
65+
],
5766
'id' => 1,
5867
'value' => '300.55',
5968
]);
@@ -74,6 +83,15 @@ public function testPostMathNumber(): void
7483
'@context' => '/contexts/MathNumber',
7584
'@id' => '/math_numbers/2',
7685
'@type' => 'MathNumber',
86+
'operation' => [
87+
[
88+
'@type' => ['hydra:Operation', 'schema:FindAction'],
89+
'hydra:method' => 'GET',
90+
'hydra:title' => 'getMathNumber',
91+
'hydra:description' => 'Retrieves a MathNumber resource.',
92+
'returns' => 'MathNumber',
93+
],
94+
],
7795
'id' => 2,
7896
'value' => '120.23',
7997
]);

tests/Functional/PaginationDisabledTest.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,58 @@ public function testCollectionJsonLd(): void
270270
[
271271
'@id' => '/pagination_disabled_entities/1',
272272
'@type' => 'PaginationDisabledEntity',
273+
'operation' => [
274+
[
275+
'@type' => ['hydra:Operation', 'schema:FindAction'],
276+
'hydra:method' => 'GET',
277+
'hydra:title' => 'getPaginationDisabledEntity',
278+
'hydra:description' => 'Retrieves a PaginationDisabledEntity resource.',
279+
'returns' => 'owl:Nothing',
280+
],
281+
],
273282
'id' => 1,
274283
],
275284
[
276285
'@id' => '/pagination_disabled_entities/2',
277286
'@type' => 'PaginationDisabledEntity',
287+
'operation' => [
288+
[
289+
'@type' => ['hydra:Operation', 'schema:FindAction'],
290+
'hydra:method' => 'GET',
291+
'hydra:title' => 'getPaginationDisabledEntity',
292+
'hydra:description' => 'Retrieves a PaginationDisabledEntity resource.',
293+
'returns' => 'owl:Nothing',
294+
],
295+
],
278296
'id' => 2,
279297
],
280298
[
281299
'@id' => '/pagination_disabled_entities/3',
282300
'@type' => 'PaginationDisabledEntity',
301+
'operation' => [
302+
[
303+
'@type' => ['hydra:Operation', 'schema:FindAction'],
304+
'hydra:method' => 'GET',
305+
'hydra:title' => 'getPaginationDisabledEntity',
306+
'hydra:description' => 'Retrieves a PaginationDisabledEntity resource.',
307+
'returns' => 'owl:Nothing',
308+
],
309+
],
283310
'id' => 3,
284311
],
285312

286313
[
287314
'@id' => '/pagination_disabled_entities/4',
288315
'@type' => 'PaginationDisabledEntity',
316+
'operation' => [
317+
[
318+
'@type' => ['hydra:Operation', 'schema:FindAction'],
319+
'hydra:method' => 'GET',
320+
'hydra:title' => 'getPaginationDisabledEntity',
321+
'hydra:description' => 'Retrieves a PaginationDisabledEntity resource.',
322+
'returns' => 'owl:Nothing',
323+
],
324+
],
289325
'id' => 4,
290326
],
291327
],

tests/Symfony/Bundle/Test/ApiTestCaseTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@ public function testGetMercureMessages(): void
365365
"readOnly": true,
366366
"type": "string"
367367
},
368+
"operation": {
369+
"type": "array",
370+
"items": {
371+
"type": "object"
372+
}
373+
},
368374
"id": {
369375
"type": "number"
370376
},

0 commit comments

Comments
 (0)