test password login
This commit is contained in:
parent
879c294582
commit
93f5f022e4
6 changed files with 220 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue