File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
tests/Fixtures/TestBundle/Entity Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,22 @@ Feature: Handle properly invalid data submitted to the API
42
42
}
43
43
"""
44
44
45
+ Scenario : Create a resource without a required property with a strongly-typed setter
46
+ When I add "Content-Type" header equal to "application/ld+json"
47
+ And I send a "POST" request to "/dummies" with body:
48
+ """
49
+ {
50
+ "name": null
51
+ }
52
+ """
53
+ Then the response status code should be 400
54
+ And the response should be in JSON
55
+ And the header "Content-Type" should be equal to "application/ld+json; charset=utf-8"
56
+ And the JSON node "@context" should be equal to "/contexts/Error"
57
+ And the JSON node "@type" should be equal to "hydra:Error"
58
+ And the JSON node "hydra:title" should be equal to "An error occurred"
59
+ And the JSON node "hydra:description" should be equal to 'The type of the "name" attribute must be "string", "NULL" given.'
60
+
45
61
Scenario : Create a resource with wrong value type for relation
46
62
When I add "Content-Type" header equal to "application/ld+json"
47
63
And I send a "POST" request to "/dummies" with body:
Original file line number Diff line number Diff line change @@ -188,12 +188,12 @@ public function setId($id)
188
188
$ this ->id = $ id ;
189
189
}
190
190
191
- public function setName ($ name )
191
+ public function setName (string $ name )
192
192
{
193
193
$ this ->name = $ name ;
194
194
}
195
195
196
- public function getName ()
196
+ public function getName (): string
197
197
{
198
198
return $ this ->name ;
199
199
}
You can’t perform that action at this time.
0 commit comments