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.
- Loading branch information
1 parent
de9f0d1
commit b6dd0f5
Showing
1 changed file
with
15 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ | |
use App\Containers\AppSection\Authentication\Actions\WebLoginAction; | ||
use App\Containers\AppSection\Authentication\Exceptions\LoginFailedException; | ||
use App\Containers\AppSection\Authentication\Exceptions\UserNotConfirmedException; | ||
use App\Containers\AppSection\Authentication\Tests\TestCase; | ||
use App\Containers\AppSection\Authentication\UI\WEB\Requests\LoginRequest; | ||
use App\Containers\AppSection\User\Models\User; | ||
use App\Containers\AppSection\User\Tests\TestCase; | ||
use Illuminate\Support\Facades\Config; | ||
|
||
/** | ||
|
@@ -22,20 +22,6 @@ class WebLoginActionTest extends TestCase | |
private LoginRequest $request; | ||
private mixed $action; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->userDetails = [ | ||
'email' => '[email protected]', | ||
'password' => 'so-secret', | ||
'name' => 'Mahmoud', | ||
]; | ||
$this->getTestingUser($this->userDetails); | ||
$this->actingAs($this->testingUser, 'web'); | ||
$this->request = new LoginRequest($this->userDetails); | ||
$this->action = app(WebLoginAction::class); | ||
} | ||
|
||
public function testLogin(): void | ||
{ | ||
$user = $this->action->run($this->request); | ||
|
@@ -67,4 +53,18 @@ public function testGivenEmailConfirmationIsRequiredAndUserIsNotConfirmedThrowsA | |
|
||
Config::set('appSection-authentication.require_email_confirmation', $configInitialValue); | ||
} | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->userDetails = [ | ||
'email' => '[email protected]', | ||
'password' => 'so-secret', | ||
'name' => 'Mahmoud', | ||
]; | ||
$this->getTestingUser($this->userDetails); | ||
$this->actingAs($this->testingUser, 'web'); | ||
$this->request = new LoginRequest($this->userDetails); | ||
$this->action = app(WebLoginAction::class); | ||
} | ||
} |