Customer login test

This commit is contained in:
Jérémy Munsch 2021-08-12 08:39:51 +02:00
parent 119aa76e73
commit a472e82768
2 changed files with 12 additions and 1 deletions

View file

@ -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'

View file

@ -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);