fix: ✅ update and pass all tests
This commit is contained in:
parent
16e4e4ee19
commit
b36aa19028
2 changed files with 14 additions and 14 deletions
|
|
@ -53,16 +53,16 @@ class ClaimTest extends ApiBase
|
|||
$response = $this->callApiWithToken($service, 'post', route('apiV4.claim.store'), \array_merge(
|
||||
$this->skeleton,
|
||||
[
|
||||
'brand_id' => $brand->getKey(),
|
||||
'subject_id' => $subject->getKey(),
|
||||
'customer_id' => $customer->getKey(),
|
||||
'brand_id' => $brand->getKey(),
|
||||
'subject_id' => $subject->getKey(),
|
||||
'hashcode' => $customer->hashcode,
|
||||
]
|
||||
));
|
||||
$claimModel = Claim::query()->where([
|
||||
['email', 'claim@hotmail.fr'],
|
||||
['brand_id', $brand->getKey()],
|
||||
['subject_id', $subject->getKey()],
|
||||
['customer_id', $customer->getKey()],
|
||||
['hashcode', $customer->hashcode],
|
||||
])->exists();
|
||||
$json = $response->decodeResponseJson();
|
||||
$this->assertApiResponseStatusIs($json, ApiStatus::OK);
|
||||
|
|
@ -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::exists(ltrim($claimModel->file, '/')),
|
||||
Storage::disk('public')->exists(str_replace('storage/', '', $claimModel->file)),
|
||||
"The file does not exist: {$claimModel->file}"
|
||||
);
|
||||
}
|
||||
|
|
@ -90,9 +90,9 @@ class ClaimTest extends ApiBase
|
|||
$response = $this->callApiWithToken($service, 'post', route('apiV4.claim.store'), \array_merge(
|
||||
$this->skeleton,
|
||||
[
|
||||
'brand_id' => 0,
|
||||
'subject_id' => 0,
|
||||
'customer_id' => 0,
|
||||
'brand_id' => 0,
|
||||
'subject_id' => 0,
|
||||
'hashcode' => null,
|
||||
]
|
||||
));
|
||||
$json = $response->decodeResponseJson();
|
||||
|
|
@ -122,7 +122,7 @@ class ClaimTest extends ApiBase
|
|||
['email', 'claim@hotmail.fr'],
|
||||
['brand_id', $brand->getKey()],
|
||||
['subject_id', $subject->getKey()],
|
||||
['customer_id', null],
|
||||
['hashcode', null],
|
||||
])->exists();
|
||||
$json = $response->decodeResponseJson();
|
||||
$this->assertApiResponseStatusIs($json, ApiStatus::OK);
|
||||
|
|
@ -147,10 +147,10 @@ class ClaimTest extends ApiBase
|
|||
$response = $this->callApiWithToken($service, 'post', route('apiV4.claim.store'), \array_merge(
|
||||
Arr::except($this->skeleton, ['address', 'city', 'postcode', 'file']),
|
||||
[
|
||||
'file' => $base64Gif,
|
||||
'brand_id' => $brand->getKey(),
|
||||
'subject_id' => $subject->getKey(),
|
||||
'customer_id' => $customer->getKey(),
|
||||
'file' => $base64Gif,
|
||||
'brand_id' => $brand->getKey(),
|
||||
'subject_id' => $subject->getKey(),
|
||||
'hashcode' => $customer->hashcode,
|
||||
]
|
||||
));
|
||||
$json = $response->decodeResponseJson();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,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::exists(ltrim($claimModel->file, '/')),
|
||||
Storage::disk('public')->exists(str_replace('storage/', '', $claimModel->file)),
|
||||
"The file does not exist: {$claimModel->file}"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue