diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index 2a9dcc9b129..28a2abefc05 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -278,6 +278,9 @@ public function testFieldIsNullableByType(): void // Explicit Not Nullable $this->assertFalse($class->isNullable('username')); + + $this->assertEquals(CmsEmail::class, $class->getAssociationMapping('email')['targetEntity']); + $this->assertEquals(CmsEmail::class, $class->getAssociationMapping('mainEmail')['targetEntity']); } public function testFieldTypeFromReflection(): void diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index 900736c9a21..ae142ad70c0 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -127,6 +127,12 @@ public function testFieldIsNullableByType(): void // Explicit Not Nullable $cm->mapField(['fieldName' => 'username', 'length' => 50]); $this->assertFalse($cm->isNullable('username')); + + $cm->mapOneToOne(['fieldName' => 'email', 'joinColumns' => [[]]]); + $this->assertEquals(CmsEmail::class, $cm->getAssociationMapping('email')['targetEntity']); + + $cm->mapManyToOne(['fieldName' => 'mainEmail']); + $this->assertEquals(CmsEmail::class, $cm->getAssociationMapping('mainEmail')['targetEntity']); } public function testFieldTypeFromReflection(): void