Customer login test
This commit is contained in:
parent
119aa76e73
commit
a472e82768
2 changed files with 12 additions and 1 deletions
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue