add unit tests for user and auth
This commit is contained in:
parent
613180d459
commit
410b752183
6 changed files with 315 additions and 0 deletions
20
backend/tests/Unit/User/UserTest.php
Normal file
20
backend/tests/Unit/User/UserTest.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\User;
|
||||
|
||||
use App\Shared\ValueObject\EmailAddress;
|
||||
use App\User\User;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class UserTest extends TestCase
|
||||
{
|
||||
public function testCreatesUserWithPasswordHash(): void
|
||||
{
|
||||
$email = new EmailAddress('test@example.com');
|
||||
$user = new User(1, $email, 'hashed-password');
|
||||
|
||||
$this->assertSame(1, $user->getId());
|
||||
$this->assertSame($email, $user->getEmail());
|
||||
$this->assertSame('hashed-password', $user->getPasswordHash());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue