Skip to content

Commit

Permalink
Address review comment about keeping the target entity type detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed May 10, 2021
1 parent 1add3d8 commit 4e462cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e462cd

Please sign in to comment.