Skip to content

Commit ed8c19f

Browse files
authored
Merge pull request #3243 from antograssiot/improve-tests
Improve tests
2 parents 53e35d7 + 4904711 commit ed8c19f

File tree

8 files changed

+125
-334
lines changed

8 files changed

+125
-334
lines changed

features/doctrine/date_filter.feature

Lines changed: 69 additions & 285 deletions
Large diffs are not rendered by default.

features/doctrine/exists_filter.feature

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ Feature: Exists filter on collections
4747
"@context": {"pattern": "^/contexts/Dummy$"},
4848
"@id": {"pattern": "^/dummies$"},
4949
"@type": {"pattern": "^hydra:Collection$"},
50-
"hydra:totalItems": {"type":"number", "minimum": 3},
50+
"hydra:totalItems": {"type":"number", "minimum": 15, "minimum": 15},
5151
"hydra:member": {
5252
"type": "array",
53+
"items": {
54+
"type": "object",
55+
"properties": {
56+
"@id": {"pattern": "^/dummies/(1|2|3)$"}
57+
},
58+
"required": ["@id"]
59+
},
5360
"minItems": 3
5461
},
5562
"hydra:view": {

features/hal/max_depth.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ Feature: Max depth handling
2424
{
2525
"_links": {
2626
"self": {
27-
"href": "\/max_depth_eager_dummies\/1"
27+
"href": "/max_depth_eager_dummies/1"
2828
},
2929
"child": {
30-
"href": "\/max_depth_eager_dummies\/2"
30+
"href": "/max_depth_eager_dummies/2"
3131
}
3232
},
3333
"_embedded": {
3434
"child": {
3535
"_links": {
3636
"self": {
37-
"href": "\/max_depth_eager_dummies\/2"
37+
"href": "/max_depth_eager_dummies/2"
3838
}
3939
},
4040
"id": 2,
@@ -69,17 +69,17 @@ Feature: Max depth handling
6969
{
7070
"_links": {
7171
"self": {
72-
"href": "\/max_depth_eager_dummies\/1"
72+
"href": "/max_depth_eager_dummies/1"
7373
},
7474
"child": {
75-
"href": "\/max_depth_eager_dummies\/2"
75+
"href": "/max_depth_eager_dummies/2"
7676
}
7777
},
7878
"_embedded": {
7979
"child": {
8080
"_links": {
8181
"self": {
82-
"href": "\/max_depth_eager_dummies\/2"
82+
"href": "/max_depth_eager_dummies/2"
8383
}
8484
},
8585
"id": 2,
@@ -115,17 +115,17 @@ Feature: Max depth handling
115115
{
116116
"_links": {
117117
"self": {
118-
"href": "\/max_depth_dummies\/1"
118+
"href": "/max_depth_dummies/1"
119119
},
120120
"child": {
121-
"href": "\/max_depth_dummies\/2"
121+
"href": "/max_depth_dummies/2"
122122
}
123123
},
124124
"_embedded": {
125125
"child": {
126126
"_links": {
127127
"self": {
128-
"href": "\/max_depth_dummies\/2"
128+
"href": "/max_depth_dummies/2"
129129
}
130130
},
131131
"id": 2,

features/jsonapi/errors.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Feature: JSON API error handling
2828
{
2929
"detail": "This value should not be blank.",
3030
"source": {
31-
"pointer": "data\/attributes\/name"
31+
"pointer": "data/attributes/name"
3232
}
3333
}
3434
]
@@ -59,13 +59,13 @@ Feature: JSON API error handling
5959
{
6060
"detail": "This value should not be null.",
6161
"source": {
62-
"pointer": "data\/relationships\/dummyFriend"
62+
"pointer": "data/relationships/dummyFriend"
6363
}
6464
},
6565
{
6666
"detail": "This value should not be null.",
6767
"source": {
68-
"pointer": "data\/relationships\/relatedDummy"
68+
"pointer": "data/relationships/relatedDummy"
6969
}
7070
}
7171
]

features/jsonapi/related-resouces-inclusion.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Feature: JSON API Inclusion of Related Resources
3838
},
3939
"included": [
4040
{
41-
"id": "\/dummy_groups\/1",
41+
"id": "/dummy_groups/1",
4242
"type": "DummyGroup",
4343
"attributes": {
4444
"_id": 1,
@@ -107,7 +107,7 @@ Feature: JSON API Inclusion of Related Resources
107107
},
108108
"included": [
109109
{
110-
"id": "\/dummy_groups\/1",
110+
"id": "/dummy_groups/1",
111111
"type": "DummyGroup",
112112
"attributes": {
113113
"_id": 1,
@@ -140,7 +140,7 @@ Feature: JSON API Inclusion of Related Resources
140140
},
141141
"included": [
142142
{
143-
"id": "\/dummy_groups\/1",
143+
"id": "/dummy_groups/1",
144144
"type": "DummyGroup",
145145
"attributes": {
146146
"_id": 1,
@@ -402,7 +402,7 @@ Feature: JSON API Inclusion of Related Resources
402402
"""
403403
{
404404
"links": {
405-
"self": "\/dummy_properties?include=group"
405+
"self": "/dummy_properties?include=group"
406406
},
407407
"meta": {
408408
"totalItems": 3,
@@ -470,7 +470,7 @@ Feature: JSON API Inclusion of Related Resources
470470
],
471471
"included": [
472472
{
473-
"id": "\/dummy_groups\/1",
473+
"id": "/dummy_groups/1",
474474
"type": "DummyGroup",
475475
"attributes": {
476476
"_id": 1,
@@ -480,7 +480,7 @@ Feature: JSON API Inclusion of Related Resources
480480
}
481481
},
482482
{
483-
"id": "\/dummy_groups\/2",
483+
"id": "/dummy_groups/2",
484484
"type": "DummyGroup",
485485
"attributes": {
486486
"_id": 2,
@@ -490,7 +490,7 @@ Feature: JSON API Inclusion of Related Resources
490490
}
491491
},
492492
{
493-
"id": "\/dummy_groups\/3",
493+
"id": "/dummy_groups/3",
494494
"type": "DummyGroup",
495495
"attributes": {
496496
"_id": 3,
@@ -514,7 +514,7 @@ Feature: JSON API Inclusion of Related Resources
514514
"""
515515
{
516516
"links": {
517-
"self": "\/dummy_properties?include=group"
517+
"self": "/dummy_properties?include=group"
518518
},
519519
"meta": {
520520
"totalItems": 3,
@@ -582,7 +582,7 @@ Feature: JSON API Inclusion of Related Resources
582582
],
583583
"included": [
584584
{
585-
"id": "\/dummy_groups\/1",
585+
"id": "/dummy_groups/1",
586586
"type": "DummyGroup",
587587
"attributes": {
588588
"_id": 1,

features/main/validation.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Feature: Using validations groups
2929
And the JSON should be equal to:
3030
"""
3131
{
32-
"@context": "\/contexts\/ConstraintViolationList",
32+
"@context": "/contexts/ConstraintViolationList",
3333
"@type": "ConstraintViolationList",
3434
"hydra:title": "An error occurred",
3535
"hydra:description": "name: This value should not be null.",
@@ -57,7 +57,7 @@ Feature: Using validations groups
5757
And the JSON should be equal to:
5858
"""
5959
{
60-
"@context": "\/contexts\/ConstraintViolationList",
60+
"@context": "/contexts/ConstraintViolationList",
6161
"@type": "ConstraintViolationList",
6262
"hydra:title": "An error occurred",
6363
"hydra:description": "title: This value should not be null.",

features/serializer/group_filter.feature

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,8 @@ Feature: Filter with serialization groups on items and collections
731731
And the JSON should be equal to:
732732
"""
733733
{
734-
"@context": "\/contexts\/DummyGroup",
735-
"@id": "\/dummy_groups\/11",
734+
"@context": "/contexts/DummyGroup",
735+
"@id": "/dummy_groups/11",
736736
"@type": "DummyGroup",
737737
"id": 11,
738738
"foo": "Foo",
@@ -758,8 +758,8 @@ Feature: Filter with serialization groups on items and collections
758758
And the JSON should be equal to:
759759
"""
760760
{
761-
"@context": "\/contexts\/DummyGroup",
762-
"@id": "\/dummy_groups\/12",
761+
"@context": "/contexts/DummyGroup",
762+
"@id": "/dummy_groups/12",
763763
"@type": "DummyGroup",
764764
"foo": "Foo"
765765
}
@@ -782,8 +782,8 @@ Feature: Filter with serialization groups on items and collections
782782
And the JSON should be equal to:
783783
"""
784784
{
785-
"@context": "\/contexts\/DummyGroup",
786-
"@id": "\/dummy_groups\/13",
785+
"@context": "/contexts/DummyGroup",
786+
"@id": "/dummy_groups/13",
787787
"@type": "DummyGroup",
788788
"id": 13,
789789
"foo": "Foo",
@@ -810,8 +810,8 @@ Feature: Filter with serialization groups on items and collections
810810
And the JSON should be equal to:
811811
"""
812812
{
813-
"@context": "\/contexts\/DummyGroup",
814-
"@id": "\/dummy_groups\/14",
813+
"@context": "/contexts/DummyGroup",
814+
"@id": "/dummy_groups/14",
815815
"@type": "DummyGroup",
816816
"foo": "Foo",
817817
"baz": "Baz",
@@ -836,8 +836,8 @@ Feature: Filter with serialization groups on items and collections
836836
And the JSON should be equal to:
837837
"""
838838
{
839-
"@context": "\/contexts\/DummyGroup",
840-
"@id": "\/dummy_groups\/15",
839+
"@context": "/contexts/DummyGroup",
840+
"@id": "/dummy_groups/15",
841841
"@type": "DummyGroup",
842842
"id": 15,
843843
"foo": "Foo",
@@ -864,8 +864,8 @@ Feature: Filter with serialization groups on items and collections
864864
And the JSON should be equal to:
865865
"""
866866
{
867-
"@context": "\/contexts\/DummyGroup",
868-
"@id": "\/dummy_groups\/16",
867+
"@context": "/contexts/DummyGroup",
868+
"@id": "/dummy_groups/16",
869869
"@type": "DummyGroup",
870870
"id": 16,
871871
"foo": "Foo",
@@ -892,8 +892,8 @@ Feature: Filter with serialization groups on items and collections
892892
And the JSON should be equal to:
893893
"""
894894
{
895-
"@context": "\/contexts\/DummyGroup",
896-
"@id": "\/dummy_groups\/17",
895+
"@context": "/contexts/DummyGroup",
896+
"@id": "/dummy_groups/17",
897897
"@type": "DummyGroup",
898898
"id": 17,
899899
"foo": "Foo",
@@ -919,8 +919,8 @@ Feature: Filter with serialization groups on items and collections
919919
And the JSON should be equal to:
920920
"""
921921
{
922-
"@context": "\/contexts\/DummyGroup",
923-
"@id": "\/dummy_groups\/18",
922+
"@context": "/contexts/DummyGroup",
923+
"@id": "/dummy_groups/18",
924924
"@type": "DummyGroup"
925925
}
926926
"""
@@ -942,8 +942,8 @@ Feature: Filter with serialization groups on items and collections
942942
And the JSON should be equal to:
943943
"""
944944
{
945-
"@context": "\/contexts\/DummyGroup",
946-
"@id": "\/dummy_groups\/19",
945+
"@context": "/contexts/DummyGroup",
946+
"@id": "/dummy_groups/19",
947947
"@type": "DummyGroup",
948948
"id": 19,
949949
"foo": "Foo",
@@ -969,8 +969,8 @@ Feature: Filter with serialization groups on items and collections
969969
And the JSON should be equal to:
970970
"""
971971
{
972-
"@context": "\/contexts\/DummyGroup",
973-
"@id": "\/dummy_groups\/20",
972+
"@context": "/contexts/DummyGroup",
973+
"@id": "/dummy_groups/20",
974974
"@type": "DummyGroup",
975975
"baz": "Baz"
976976
}

features/serializer/property_filter.feature

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ Feature: Filter with serialization attributes on items and collections
368368
And the JSON should be equal to:
369369
"""
370370
{
371-
"@context": "\/contexts\/DummyProperty",
372-
"@id": "\/dummy_properties\/11",
371+
"@context": "/contexts/DummyProperty",
372+
"@id": "/dummy_properties/11",
373373
"@type": "DummyProperty",
374374
"foo": "Foo",
375375
"bar": "Bar"
@@ -396,13 +396,13 @@ Feature: Filter with serialization attributes on items and collections
396396
And the JSON should be equal to:
397397
"""
398398
{
399-
"@context": "\/contexts\/DummyProperty",
400-
"@id": "\/dummy_properties\/12",
399+
"@context": "/contexts/DummyProperty",
400+
"@id": "/dummy_properties/12",
401401
"@type": "DummyProperty",
402402
"foo": "Foo",
403403
"bar": "Bar",
404404
"group": {
405-
"@id": "\/dummy_groups\/11",
405+
"@id": "/dummy_groups/11",
406406
"@type": "DummyGroup",
407407
"foo": "Foo",
408408
"baz": null

0 commit comments

Comments
 (0)