From 020fd8b09270fb6a850e8a684bd5e7d5badb11c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 28 Jun 2023 14:53:26 +0200 Subject: [PATCH] Fix testApiAuthenticateCustomerShouldFailIfCustomerNotActivated having random results --- tests/CRM/ApiV2/CustomerTest.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/CRM/ApiV2/CustomerTest.php b/tests/CRM/ApiV2/CustomerTest.php index ba84bb4..2af4223 100644 --- a/tests/CRM/ApiV2/CustomerTest.php +++ b/tests/CRM/ApiV2/CustomerTest.php @@ -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',