diff --git a/tests/Client/CrmClientV2CustomerTest.php b/tests/Client/CrmClientV2CustomerTest.php index e800bda..e20d0ed 100644 --- a/tests/Client/CrmClientV2CustomerTest.php +++ b/tests/Client/CrmClientV2CustomerTest.php @@ -310,6 +310,12 @@ class CrmClientV2CustomerTest extends CrmClientTester $customer = $api->getCustomerOrNew(static::$info->hashcode); $this->assertEquals(Country::belgium(), $customer->country); + $customer->country = Country::france(); + $customer->save(); + + $customer = $api->getCustomerOrNew(static::$info->hashcode); + $this->assertEquals(Country::france(), $customer->country); + $customer->email = 'pouet@gmail.com'; $customer->birth_date = '1992-03-08'; $customer->phone = '0388977213'; @@ -499,18 +505,18 @@ class CrmClientV2CustomerTest extends CrmClientTester private function createNewCustomer(array $data, Brand $brand) { $customer = \App\Models\Customer::whereEmail($data['email']) - ->whereHas('brands', function ($q) use ($brand) { - $q->where('brands.id', '=', $brand->id); - })->firstOrNew(); + ->whereHas('brands', function ($q) use ($brand) { + $q->where('brands.id', '=', $brand->id); + })->firstOrNew(); $customer->fill($data); $saved = $customer->save(); // * Delete Single optin if exists. /** @var \App\Models\SingleOptin|null $singleOptin */ $singleOptin = SingleOptin::query()->where('email', $data['email']) - ->whereHas('brand', function ($q) use ($brand) { - $q->where('brands.id', '=', $brand->id); - })->first(); + ->whereHas('brand', function ($q) use ($brand) { + $q->where('brands.id', '=', $brand->id); + })->first(); if ($singleOptin) { $saved = $singleOptin->delete() && $saved; }