8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52a4848 commit aa6192dCopy full SHA for aa6192d
tests/dummy/tests/Feature/Avatars/CreateTest.php
@@ -66,4 +66,22 @@ public function test(string $contentType): void
66
67
Storage::disk('local')->assertExists($path);
68
}
69
+
70
+ public function testFileIsRequired(): void
71
+ {
72
+ $user = factory(User::class)->create();
73
74
+ /** @var TestResponse $response */
75
+ $response = $this->actingAs($user, 'api')->post(
76
+ '/api/v1/avatars',
77
+ ['avatar' => null],
78
+ ['Content-Type' => 'multipart/form-data', 'Content-Length' => '1']
79
+ );
80
81
+ $response->assertExactErrorStatus([
82
+ 'title' => 'Unprocessable Entity',
83
+ 'status' => '422',
84
+ 'detail' => 'The avatar field is required.',
85
+ ]);
86
+ }
87
0 commit comments