From d8035294a3b42d6f082fe879c03c5c212dc312f7 Mon Sep 17 00:00:00 2001 From: Martin Zurowietz Date: Wed, 4 Oct 2023 12:09:06 +0200 Subject: [PATCH] Update tests for Laravel 10 References https://github.com/biigle/core/pull/665 --- tests/Http/Controllers/Api/Import/ImportControllerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Http/Controllers/Api/Import/ImportControllerTest.php b/tests/Http/Controllers/Api/Import/ImportControllerTest.php index 74f7ffc..da9b17b 100644 --- a/tests/Http/Controllers/Api/Import/ImportControllerTest.php +++ b/tests/Http/Controllers/Api/Import/ImportControllerTest.php @@ -30,7 +30,7 @@ public function testStore() $user = UserTest::create(); $path = (new UserExport([$user->id]))->getArchive(); - $wrongFile = new UploadedFile($path, 'file.txt', 'text/plain', null, true); + $wrongFile = UploadedFile::fake()->create('file.txt', 10, 'text/plain'); $file = new UploadedFile($path, 'biigle_user_export.zip', 'application/zip', null, true); $this->doTestApiRoute('POST', '/api/v1/import'); @@ -41,7 +41,7 @@ public function testStore() $this->beGlobalAdmin(); $this->json('POST', '/api/v1/import')->assertStatus(422); - $this->json('POST', '/api/v1/import', [], [], ['archive' => $wrongFile]) + $this->json('POST', '/api/v1/import', ['archive' => $wrongFile]) ->assertStatus(422); $this->call('POST', '/api/v1/import', [], [], ['archive' => $file])