Skip to content

Commit

Permalink
fix wrong import & refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Oct 3, 2021
1 parent de9f0d1 commit b6dd0f5
Showing 1 changed file with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
}

0 comments on commit b6dd0f5

Please sign in to comment.