Refatoring : Working state
This commit is contained in:
@@ -4,12 +4,12 @@ declare(strict_types=1);
|
||||
namespace Tests\Auth;
|
||||
|
||||
use App\Auth\Exception\InvalidResetTokenException;
|
||||
use App\Auth\Infrastructure\PdoPasswordResetRepository as PasswordResetRepository;
|
||||
use App\Auth\Application\PasswordResetApplicationService as PasswordResetService;
|
||||
use App\Auth\Infrastructure\PdoPasswordResetRepository;
|
||||
use App\Auth\Application\PasswordResetApplicationService;
|
||||
use App\Shared\Database\Migrator;
|
||||
use App\Shared\Mail\MailServiceInterface;
|
||||
use App\User\User;
|
||||
use App\User\Infrastructure\PdoUserRepository as UserRepository;
|
||||
use App\User\Infrastructure\PdoUserRepository;
|
||||
use PDO;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
@@ -18,9 +18,9 @@ use PHPUnit\Framework\TestCase;
|
||||
final class PasswordResetServiceIntegrationTest extends TestCase
|
||||
{
|
||||
private PDO $db;
|
||||
private PasswordResetService $service;
|
||||
private UserRepository $users;
|
||||
private PasswordResetRepository $resets;
|
||||
private PasswordResetApplicationService $service;
|
||||
private PdoUserRepository $users;
|
||||
private PdoPasswordResetRepository $resets;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
@@ -31,15 +31,15 @@ final class PasswordResetServiceIntegrationTest extends TestCase
|
||||
$this->db->sqliteCreateFunction('strip_tags', 'strip_tags', 1);
|
||||
Migrator::run($this->db);
|
||||
|
||||
$this->users = new UserRepository($this->db);
|
||||
$this->resets = new PasswordResetRepository($this->db);
|
||||
$this->users = new PdoUserRepository($this->db);
|
||||
$this->resets = new PdoPasswordResetRepository($this->db);
|
||||
$mail = new class implements MailServiceInterface {
|
||||
public function send(string $to, string $subject, string $template, array $context = []): void
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
$this->service = new PasswordResetService($this->resets, $this->users, $mail, $this->db);
|
||||
$this->service = new PasswordResetApplicationService($this->resets, $this->users, $mail, $this->db);
|
||||
}
|
||||
|
||||
public function testResetPasswordConsumesTokenOnlyOnceAndUpdatesPassword(): void
|
||||
|
||||
Reference in New Issue
Block a user