add test testApiAuthenticateCustomerShouldFail
This commit is contained in:
parent
a007b9c565
commit
6149a74cbe
1 changed files with 26 additions and 0 deletions
|
|
@ -64,6 +64,32 @@ class CustomerTest extends ApiBase
|
|||
$this->assertNotEmpty($json->json('data.hashcode'));
|
||||
}
|
||||
|
||||
/**
|
||||
* route: apiV2.customers.authenticate
|
||||
*/
|
||||
public function testApiAuthenticateCustomerShouldFail()
|
||||
{
|
||||
extract($this->getCustomer());
|
||||
$response = $this->callApiWithToken(
|
||||
$service,
|
||||
'post',
|
||||
route('apiV2.customers.authenticate', []),
|
||||
[
|
||||
'email' => $customer->email,
|
||||
'password' => 'testPasswords'
|
||||
]
|
||||
);
|
||||
|
||||
$json = $response->decodeResponseJson();
|
||||
|
||||
$this->assertApiResponseStatusIs($json, ApiStatus::KO());
|
||||
$this->assertNotEmpty($json->json('data'));
|
||||
$this->assertNotEmpty($json->json('data.message'));
|
||||
$this->assertNotEmpty($json->json('data.code'));
|
||||
$this->assertEquals(ApiError::authFailed()->value, $json->json('data.code'));
|
||||
$this->assertEquals(ApiError::authFailed()->label, $json->json('data.message'));
|
||||
}
|
||||
|
||||
/**
|
||||
* route: apiV2.customers.store
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue