feat: Setup projet Classeo avec infrastructure Docker et architecture DDD
Configure l'environnement de développement complet avec Docker Compose, structure DDD 4 Bounded Contexts, et pipeline CI/CD GitHub Actions. Corrections compatibilité CI: - Symfony 8 nécessite monolog-bundle ^4.0 (la v3.x ne supporte que jusqu'à Symfony 7) - ESLint v9 nécessite flat config (eslint.config.js) - le format .eslintrc.cjs est obsolète
This commit is contained in:
58
backend/tests/Unit/Shared/Domain/EntityIdTest.php
Normal file
58
backend/tests/Unit/Shared/Domain/EntityIdTest.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Unit\Shared\Domain;
|
||||
|
||||
use App\Shared\Domain\EntityId;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
final class EntityIdTest extends TestCase
|
||||
{
|
||||
public function testGenerateCreatesValidUuid(): void
|
||||
{
|
||||
$id = TestEntityId::generate();
|
||||
|
||||
$this->assertInstanceOf(TestEntityId::class, $id);
|
||||
$this->assertTrue(Uuid::isValid((string) $id));
|
||||
}
|
||||
|
||||
public function testFromStringCreatesEntityIdFromValidUuid(): void
|
||||
{
|
||||
$uuid = '550e8400-e29b-41d4-a716-446655440000';
|
||||
$id = TestEntityId::fromString($uuid);
|
||||
|
||||
$this->assertSame($uuid, (string) $id);
|
||||
}
|
||||
|
||||
public function testEqualsReturnsTrueForSameValue(): void
|
||||
{
|
||||
$uuid = '550e8400-e29b-41d4-a716-446655440000';
|
||||
$id1 = TestEntityId::fromString($uuid);
|
||||
$id2 = TestEntityId::fromString($uuid);
|
||||
|
||||
$this->assertTrue($id1->equals($id2));
|
||||
}
|
||||
|
||||
public function testEqualsReturnsFalseForDifferentValue(): void
|
||||
{
|
||||
$id1 = TestEntityId::generate();
|
||||
$id2 = TestEntityId::generate();
|
||||
|
||||
$this->assertFalse($id1->equals($id2));
|
||||
}
|
||||
|
||||
public function testToStringReturnsUuidString(): void
|
||||
{
|
||||
$uuid = '550e8400-e29b-41d4-a716-446655440000';
|
||||
$id = TestEntityId::fromString($uuid);
|
||||
|
||||
$this->assertSame($uuid, (string) $id);
|
||||
}
|
||||
}
|
||||
|
||||
// Test concrete implementation
|
||||
final readonly class TestEntityId extends EntityId
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user