From 0cf95fbccb78be7caaec2a9d835f1e1ee7ae497c Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Thu, 4 Sep 2025 16:50:41 +0200 Subject: [PATCH] Try to reproduce the #11488 issue --- .../ORM/Functional/Ticket/GH11488Test.php | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/Tests/ORM/Functional/Ticket/GH11488Test.php diff --git a/tests/Tests/ORM/Functional/Ticket/GH11488Test.php b/tests/Tests/ORM/Functional/Ticket/GH11488Test.php new file mode 100644 index 00000000000..aa79e2f3570 --- /dev/null +++ b/tests/Tests/ORM/Functional/Ticket/GH11488Test.php @@ -0,0 +1,65 @@ +_em = $this->getEntityManager(mappingDriver: new AttributeDriver([], reportFieldsWhereDeclared: true)); + + $this->setUpEntitySchema([ + BaseEntity::class, + Mother::class, + Daughter::class, + ]); + } + + public function testSchema(): void + { + $cm = $this->_em->getClassMetadata(Daughter::class); + + self::assertSame([0 => 'id'], $cm->getIdentifier()); + self::assertSame(['id'], $cm->getFieldNames()); + } +} + +namespace Doctrine\Tests\ORM\Functional\Ticket\GH11488\Somewhere; + +use Doctrine\ORM\Mapping as ORM; + +#[ORM\MappedSuperclass] +abstract class BaseEntity +{ + #[ORM\Id, ORM\Column] + protected ?int $id; +} + +namespace Doctrine\Tests\ORM\Functional\Ticket\GH11488\SomewhereElse; + +use Doctrine\ORM\Mapping as ORM; +use Doctrine\Tests\ORM\Functional\Ticket\GH11488\Somewhere\BaseEntity; + +#[ORM\MappedSuperclass] +abstract class Mother extends BaseEntity +{ +} + +namespace Doctrine\Tests\ORM\Functional\Ticket\GH11488\YetSomewhereElse; + +use Doctrine\ORM\Mapping as ORM; +use Doctrine\Tests\ORM\Functional\Ticket\GH11488\SomewhereElse\Mother; + +#[ORM\Entity] +class Daughter extends Mother +{ +}