test password login

This commit is contained in:
Yisroel Baum 2026-07-31 11:34:50 +03:00
parent 879c294582
commit 93f5f022e4
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
6 changed files with 220 additions and 0 deletions

View file

@ -2,6 +2,8 @@
namespace Tests\Feature\Database;
use App\Shared\ValueObject\EmailAddress;
use App\User\UserRepository;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
@ -17,6 +19,17 @@ class DatabaseSeederTest extends TestCase
$this->assertDatabaseHas('users', [
'email' => 'user@example.com',
]);
$this->assertDatabaseMissing('users', [
'email' => 'user@example.com',
'password' => 'password',
]);
$this->assertDatabaseCount('users', 1);
$user = app(UserRepository::class)->findByCredentials(
new EmailAddress('user@example.com'),
'password',
);
$this->assertNotNull($user);
}
}