From f7e49a53be4c057a01935b777ece7903c8b575f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 23 Apr 2023 10:34:12 +0200 Subject: [PATCH] Use valid relationships During a recent refactoring, I had to pick a relationship type for this piece of code, and I chose wrong, because a many-to-one cannot have a mappedBy field. --- tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index 1b701d93cd7..d75ca619570 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -14,9 +14,9 @@ use Doctrine\ORM\Mapping\DefaultTypedFieldMapper; use Doctrine\ORM\Mapping\DiscriminatorColumnMapping; use Doctrine\ORM\Mapping\JoinTableMapping; -use Doctrine\ORM\Mapping\ManyToOneAssociationMapping; use Doctrine\ORM\Mapping\MappedSuperclass; use Doctrine\ORM\Mapping\MappingException; +use Doctrine\ORM\Mapping\OneToManyAssociationMapping; use Doctrine\ORM\Mapping\UnderscoreNamingStrategy; use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Persistence\Mapping\StaticReflectionService; @@ -355,13 +355,13 @@ public function testDuplicateAssociationMappingException(): void $cm = new ClassMetadata(CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); - $a1 = ManyToOneAssociationMapping::fromMappingArray([ + $a1 = OneToManyAssociationMapping::fromMappingArray([ 'fieldName' => 'foo', 'sourceEntity' => stdClass::class, 'targetEntity' => stdClass::class, 'mappedBy' => 'foo', ]); - $a2 = ManyToOneAssociationMapping::fromMappingArray([ + $a2 = OneToManyAssociationMapping::fromMappingArray([ 'fieldName' => 'foo', 'sourceEntity' => stdClass::class, 'targetEntity' => stdClass::class,