Fix testApiAuthenticateCustomerShouldFailIfCustomerNotActivated having random results

This commit is contained in:
Jérémy Munsch 2023-06-28 14:53:26 +02:00
parent 6be77f21c6
commit 020fd8b092
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC

View file

@ -144,7 +144,13 @@ class CustomerTest extends ApiBase
*/
public function testApiAuthenticateCustomerShouldFailIfCustomerNotActivated()
{
extract($this->getCustomer(false));
$login = CustomerLogin::query()->where('status', false)->firstOrFail();
/** @var \App\Models\Brand $brand */
$brand = $login->brand;
/** @var \App\Models\Customer $customer */
$customer = $login->customer;
/** @var \App\Models\Service $service */
$service = $brand->services()->firstOrFail();
$response = $this->callApiWithToken(
$service,
'post',