image('testIcon.jpg'); $response = $this->json('POST', '/api/v1/icons', [ 'icon' => $file, ]) ->assertCreated() ->assertJsonStructure([ 'filename' ]); } /** * @test */ public function test_upload_with_invalid_data_returns_validation_error() { $response = $this->json('POST', '/api/v1/icons', [ 'icon' => null, ]) ->assertStatus(422); } /** * @test */ public function test_delete_icon_returns_success() { $response = $this->json('DELETE', '/api/v1/icons/testIcon.jpg') ->assertNoContent(204); } /** * @test */ public function test_delete_invalid_icon_returns_success() { $response = $this->json('DELETE', '/api/v1/icons/null') ->assertNoContent(204); } }