diff --git a/doctrine-mapping.xsd b/doctrine-mapping.xsd index a058787746c..651c9d29c09 100644 --- a/doctrine-mapping.xsd +++ b/doctrine-mapping.xsd @@ -375,7 +375,7 @@ - + diff --git a/tests/Tests/Models/Customer/CustomerType.php b/tests/Tests/Models/Customer/CustomerType.php new file mode 100644 index 00000000000..bd68c07ecf2 --- /dev/null +++ b/tests/Tests/Models/Customer/CustomerType.php @@ -0,0 +1,16 @@ +name = $name; + } +} diff --git a/tests/Tests/Models/Customer/ExternalCustomer.php b/tests/Tests/Models/Customer/ExternalCustomer.php new file mode 100644 index 00000000000..cf50d3e85e0 --- /dev/null +++ b/tests/Tests/Models/Customer/ExternalCustomer.php @@ -0,0 +1,13 @@ +getAssociationMappedByTargetField('foo'); } + + public function testClassNameMappingDiscriminatorValue(): void + { + $driver = new XmlDriver( + __DIR__ . '/xml', + XmlDriver::DEFAULT_FILE_EXTENSION, + true + ); + $xmlElement = $driver->getElement(CustomerType::class); + self::assertEquals( + 'Doctrine\Tests\Models\Customer\InternalCustomer', + $xmlElement->children()->{'discriminator-map'}->{'discriminator-mapping'}[0]->attributes()['value'] + ); + } } /** @MappedSuperclass */ diff --git a/tests/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Customer.CustomerType.dcm.xml b/tests/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Customer.CustomerType.dcm.xml new file mode 100644 index 00000000000..8767e3220a8 --- /dev/null +++ b/tests/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Customer.CustomerType.dcm.xml @@ -0,0 +1,14 @@ + + + + + + + + + + +