From 1920acf6e634bc75d73b8d08abb21073be86c63c Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Tue, 31 Mar 2026 15:01:10 +0200 Subject: [PATCH] =?UTF-8?q?test:=20=E2=9C=85=20update=20and=20pass=20all?= =?UTF-8?q?=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/CRM/ApiV4/ClaimTest.php | 4 ++-- tests/Client/CrmClientClaimTest.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/CRM/ApiV4/ClaimTest.php b/tests/CRM/ApiV4/ClaimTest.php index d77a021..1ce23c1 100644 --- a/tests/CRM/ApiV4/ClaimTest.php +++ b/tests/CRM/ApiV4/ClaimTest.php @@ -4,6 +4,7 @@ namespace Tests\CRM\ApiV4; use App\Enums\ApiError; use App\Enums\ApiStatus; +use App\Lib\Helpers\FileHelper; use App\Models\Claim; use App\Models\ClaimSubject; use App\Models\Customer; @@ -55,7 +56,6 @@ class ClaimTest extends ApiBase [ 'brand_id' => $brand->getKey(), 'subject_id' => $subject->getKey(), - 'hashcode' => $customer->hashcode, ] )); $claimModel = Claim::query()->where([ @@ -72,7 +72,7 @@ class ClaimTest extends ApiBase $claimModel = Claim::query()->where('email', 'claim@hotmail.fr')->firstOrFail(); $this->assertNotEmpty($claimModel->file, 'The "file" field is empty on the Claim model.'); $this->assertTrue( - Storage::disk('public')->exists(str_replace('storage/', '', $claimModel->file)), + Storage::disk('private')->exists(FileHelper::getPrivateFilePath($claimModel->file)), "The file does not exist: {$claimModel->file}" ); } diff --git a/tests/Client/CrmClientClaimTest.php b/tests/Client/CrmClientClaimTest.php index 5dc0983..fb1d36e 100644 --- a/tests/Client/CrmClientClaimTest.php +++ b/tests/Client/CrmClientClaimTest.php @@ -2,6 +2,7 @@ namespace Tests\Client; +use App\Lib\Helpers\FileHelper; use App\Models\Claim as ModelsClaim; use Illuminate\Http\UploadedFile; use Illuminate\Support\Facades\Storage; @@ -36,7 +37,7 @@ class CrmClientClaimTest extends CrmClientTester $claimModel = ModelsClaim::query()->where('email', 'claim@hotmail.fr')->firstOrFail(); $this->assertNotEmpty($claimModel->file, 'The "file" field is empty on the Claim model.'); $this->assertTrue( - Storage::disk('public')->exists(str_replace('storage/', '', $claimModel->file)), + Storage::disk('private')->exists(FileHelper::getPrivateFilePath($claimModel->file)), "The file does not exist: {$claimModel->file}" ); }