We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa4355a commit 84ed291Copy full SHA for 84ed291
1 file changed
tests/e2e/Adapter/Scopes/Relationships/OneToOneTests.php
@@ -1041,6 +1041,20 @@ public function testIdenticalTwoWayKeyRelationship(): void
1041
);
1042
$this->assertTrue($result);
1043
1044
+ try {
1045
+ $database->createRelationship(
1046
+ collection: 'parent',
1047
+ relatedCollection: 'child',
1048
+ type: Database::RELATION_ONE_TO_MANY,
1049
+ twoWay: true,
1050
+ id: 'twoWayChildren',
1051
+ twoWayKey: 'parent_id'
1052
+ );
1053
+ $this->fail('Failed to throw Exception');
1054
+ } catch (Exception $e) {
1055
+ $this->assertEquals('Related attribute already exists', $e->getMessage());
1056
+ }
1057
+
1058
$collection = $database->getCollection('parent');
1059
$attributes = $collection->getAttribute('attributes', []);
1060
foreach ($attributes as $attribute) {
0 commit comments