. */ namespace App\Tests\Serializer; use App\Mcp\DTO\StructuralElementOverview; use App\Serializer\StructuralElementOverviewNormalizer; use PHPUnit\Framework\TestCase; final class StructuralElementOverviewNormalizerTest extends TestCase { private StructuralElementOverviewNormalizer $service; protected function setUp(): void { $this->service = new StructuralElementOverviewNormalizer(); } public function testNormalize(): void { $overview = new StructuralElementOverview(id: 42, name: 'Test Node', full_path: 'Parent → Test Node'); //Must be a plain array with exactly id+name+full_path, no JSON-LD "@id"/"@type" clutter $this->assertSame( ['id' => 42, 'name' => 'Test Node', 'full_path' => 'Parent → Test Node'], $this->service->normalize($overview) ); } public function testSupportsNormalization(): void { $this->assertFalse($this->service->supportsNormalization(new \stdClass())); $this->assertTrue($this->service->supportsNormalization(new StructuralElementOverview(id: 1, name: 'X', full_path: 'X'))); } }