forked from apiato/apiato
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better status code: on invalid credentials return 422 instead of 400 …
…now. added tests
- Loading branch information
1 parent
2897616
commit 09ef067
Showing
3 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,7 @@ public function testClientWebAdminProxyLogin(): void | |
'email' => '[email protected]', | ||
'password' => 'testingpass', | ||
]; | ||
$user = $this->getTestingUser($data); | ||
$this->actingAs($user, 'web'); | ||
$this->getTestingUser($data); | ||
|
||
$response = $this->makeCall($data); | ||
|
||
|
@@ -40,8 +39,7 @@ public function testClientWebAdminProxyUnconfirmedLogin(): void | |
'password' => 'testingpass', | ||
'email_verified_at' => null, | ||
]; | ||
$user = $this->getTestingUser($data); | ||
$this->actingAs($user, 'web'); | ||
$this->getTestingUser($data); | ||
|
||
$response = $this->makeCall($data); | ||
|
||
|
@@ -59,8 +57,7 @@ public function testLoginWithNameAttribute(): void | |
'password' => 'testingpass', | ||
'name' => 'username', | ||
]; | ||
$user = $this->getTestingUser($data); | ||
$this->actingAs($user, 'web'); | ||
$this->getTestingUser($data); | ||
$this->setLoginAttributes([ | ||
'email' => [], | ||
'name' => [], | ||
|
@@ -117,4 +114,16 @@ public function testGivenMultipleLoginAttributeIsSetThenAtLeastOneShouldBeRequir | |
'name' => 'The name field is required when none of email are present.', | ||
]); | ||
} | ||
|
||
public function testGivenWrongCredential_Throw422(): void | ||
{ | ||
$data = [ | ||
'email' => '[email protected]', | ||
'password' => 'some-unbelievable-password', | ||
]; | ||
|
||
$response = $this->makeCall($data); | ||
|
||
$response->assertStatus(422); | ||
} | ||
} |