test set persistence
This commit is contained in:
parent
783c522f7e
commit
4ac01460fd
2 changed files with 136 additions and 0 deletions
29
backend/tests/Unit/Set/SetTest.php
Normal file
29
backend/tests/Unit/Set/SetTest.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Set;
|
||||
|
||||
use App\Set\Set;
|
||||
use App\Shared\ValueObject\EmailAddress;
|
||||
use App\User\User;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class SetTest extends TestCase
|
||||
{
|
||||
public function test_it_exposes_its_identity_name_and_creator(): void
|
||||
{
|
||||
$creator = new User(
|
||||
id: 7,
|
||||
email: new EmailAddress('creator@example.com'),
|
||||
passwordHash: 'hashed-password',
|
||||
);
|
||||
$set = new Set(
|
||||
id: 42,
|
||||
name: 'Bible',
|
||||
creator: $creator,
|
||||
);
|
||||
|
||||
$this->assertSame(42, $set->getId());
|
||||
$this->assertSame('Bible', $set->getName());
|
||||
$this->assertSame($creator, $set->getCreator());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue