diff --git a/tests/Feature/ApiV2/CustomerTest.php b/tests/Feature/ApiV2/CustomerTest.php index a22204d..2fc930a 100644 --- a/tests/Feature/ApiV2/CustomerTest.php +++ b/tests/Feature/ApiV2/CustomerTest.php @@ -42,7 +42,7 @@ class CustomerTest extends ApiBase $response = $this->callApiWithToken( $service, 'post', - route('apiV2.customers.authenticate', ['customer' => $info->hashcode]), + route('apiV2.customers.authenticate', []), [ 'email' => $customer->email, 'password' => 'testPassword' diff --git a/tests/Unit/CrmClientV2CustomerTest.php b/tests/Unit/CrmClientV2CustomerTest.php index f2a2c9a..4ed021a 100644 --- a/tests/Unit/CrmClientV2CustomerTest.php +++ b/tests/Unit/CrmClientV2CustomerTest.php @@ -227,6 +227,17 @@ class CrmClientV2CustomerTest extends CrmClientTester $this->assertEquals(null, $customer->password); } + + public function testCustomerLogin() + { + $api = new CrmApiV2(); + $customer = $api->getCustomerOrNew('toto.delarogerie@gmail.com'); + $this->assertTrue($customer->activate()); + $this->assertTrue($customer->status); + + $this->assertTrue(Customer::login($customer->email, 'Complic4tEd!P4assW0rd')); + } + public function testCustomerStorePropsFails() { $this->expectException(ValidationException::class);