json('POST', '/api/icon/upload', [ 'icon' => '', ]) ->assertStatus(422); } /** * test upload icon via API * * @test */ public function testIconUpload() { $file = UploadedFile::fake()->image('testIcon.jpg'); $response = $this->json('POST', '/api/icon/upload', [ 'icon' => $file, ]) ->assertStatus(201); } /** * test delete an uploaded icon via API * * @test */ public function testIconDelete() { $response = $this->json('DELETE', '/api/icon/delete/testIcon.jpg') ->assertStatus(204); } }