Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: doctrine/orm
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 722becd415480d153e5110fac9e670577be4658c
Choose a base ref
..
head repository: doctrine/orm
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fac8d84fdb371ae849246e2743885886606c9f6a
Choose a head ref
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
17 changes: 17 additions & 0 deletions tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php
Original file line number Diff line number Diff line change
@@ -331,6 +331,23 @@ public function testSetInvalidVersionMappingThrowsException(): void
$cm->setVersionMapping($field);
}

public function testItThrowsOnJoinColumnForInverseOneToOne(): void
{
$cm = new ClassMetadata(CmsUser::class);
$cm->initializeReflection(new RuntimeReflectionService());

$this->expectException(MappingException::class);
$this->expectExceptionMessage(
'Doctrine\Tests\Models\CMS\CmsUser#address is a OneToOne inverse side, which does not allow join columns.',
);
$cm->mapOneToOne([
'fieldName' => 'address',
'targetEntity' => CmsAddress::class,
'mappedBy' => 'user',
'joinColumns' => ['non', 'empty', 'list'],
]);
}

public function testGetSingleIdentifierFieldNameMultipleIdentifierEntityThrowsException(): void
{
$cm = new ClassMetadata(CmsUser::class);