-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
132 additions
and
12 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 |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
| | ||
*/ | ||
|
||
'driver' => env('MAIL_DRIVER', 'smtp'), | ||
'driver' => env('MAIL_DRIVER', 'log'), | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
|
@@ -54,7 +54,7 @@ | |
| | ||
*/ | ||
|
||
'from' => ['address' => null, 'name' => null], | ||
'from' => ['address' => '[email protected]', 'name' => 'plunner info'], | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Click here to reset your password: {{ url('password/reset/'.$token) }} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
* | ||
!.gitignore | ||
!.htaccess |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
deny from all | ||
|
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 |
---|---|---|
|
@@ -32,15 +32,56 @@ public function testErrorNewUser() | |
|
||
public function testLogin() | ||
{ | ||
$response = $this->post('/auth/login', ['email'=>'[email protected]', 'password'=>'test'], ['Accept'=>'application/json']); | ||
$response = $this->json('POST','/auth/login', ['email'=>'[email protected]', 'password'=>'test']); | ||
$response->seeStatusCode(302); | ||
$this->assertRedirectedTo($this->baseUrl); | ||
} | ||
|
||
public function testErrorLogin() | ||
{ | ||
$response = $this->post('/auth/login', ['email'=>'[email protected]', 'password'=>'atest'], ['Accept'=>'application/json']); | ||
$response = $this->json('POST', '/auth/login', ['email'=>'[email protected]', 'password'=>'atest']); | ||
$response->seeStatusCode(302); | ||
$this->assertRedirectedTo($this->baseUrl.'/auth/login'); | ||
} | ||
|
||
public function testLogout() | ||
{ | ||
$this->json('POST','/auth/login', ['email'=>'[email protected]', 'password'=>'test']); | ||
$this->json('GET','/auth/logout'); | ||
$response = $this->json('POST','/auth/login', ['email'=>'[email protected]', 'password'=>'atest']); | ||
$response->seeStatusCode(302); | ||
$this->assertRedirectedTo($this->baseUrl.'/auth/login'); | ||
} | ||
|
||
public function testResetPassword() | ||
{ | ||
//perform restore request | ||
$response = $this->json('POST','/password/email', ['email'=>'[email protected]']); | ||
$response->seeStatusCode(200); | ||
|
||
//get the token | ||
$token = DB::table('password_resets')->where('email', '[email protected]')->value('token'); | ||
|
||
//perform reset with error | ||
$response = $this->json('POST','/password/reset', ['email'=>'[email protected]', 'password_confirmation'=>'testtest', 'password'=>'testtest', 'token'=>'re'.$token]); | ||
$response->seeStatusCode(422); | ||
|
||
//perform correct reset | ||
$response = $this->json('POST','/password/reset', ['email'=>'[email protected]', 'password_confirmation'=>'testtest', 'password'=>'testtest', 'token'=>$token]); | ||
$response->seeStatusCode(200); | ||
$this->json('GET','/auth/logout'); | ||
$response = $this->json('POST','/auth/login', ['email'=>'[email protected]', 'password'=>'test']); | ||
$response->seeStatusCode(302); | ||
$this->assertRedirectedTo($this->baseUrl.'/auth/login'); | ||
$response = $this->json('POST','/auth/login', ['email'=>'[email protected]', 'password'=>'testtest']); | ||
$response->seeStatusCode(302); | ||
$this->assertRedirectedTo($this->baseUrl); | ||
} | ||
|
||
public function testErrorResetPassword() | ||
{ | ||
//perform restore request | ||
$response = $this->json('POST', '/password/email', ['email' => '[email protected]']); | ||
$response->seeStatusCode(422); | ||
} | ||
} |