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}" ); }