File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
tests/e2e/Adapter/Scopes/Relationships Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1041,6 +1041,20 @@ public function testIdenticalTwoWayKeyRelationship(): void
10411041 );
10421042 $ this ->assertTrue ($ result );
10431043
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+
10441058 $ collection = $ database ->getCollection ('parent ' );
10451059 $ attributes = $ collection ->getAttribute ('attributes ' , []);
10461060 foreach ($ attributes as $ attribute ) {
You can’t perform that action at this time.
0 commit comments