test: ✅ update and pass all tests

This commit is contained in:
Alexis Gousseau 2026-03-31 15:01:10 +02:00
parent 2a56bf4c67
commit 1920acf6e6
No known key found for this signature in database
GPG key ID: 7F3C786EE12DBB72
2 changed files with 4 additions and 3 deletions

View file

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

View file

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