File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -670,7 +670,7 @@ public function testVirtualRelationsAttributes(): void
670670 ]));
671671 $ this ->fail ('Failed to throw exception ' );
672672 } catch (Exception $ e ) {
673- $ this ->assertTrue ($ e instanceof RelationshipException);
673+ $ this ->assertTrue ($ e instanceof RelationshipException || $ e instanceof StructureException );
674674 }
675675
676676 try {
@@ -684,7 +684,7 @@ public function testVirtualRelationsAttributes(): void
684684 ]));
685685 $ this ->fail ('Failed to throw exception ' );
686686 } catch (Exception $ e ) {
687- $ this ->assertTrue ($ e instanceof RelationshipException);
687+ $ this ->assertTrue ($ e instanceof RelationshipException || $ e instanceof StructureException );
688688 }
689689
690690 try {
Original file line number Diff line number Diff line change @@ -1079,15 +1079,18 @@ public function testIdenticalTwoWayKeyRelationship(): void
10791079 $ this ->assertEquals ('Relationship already exists ' , $ e ->getMessage ());
10801080 }
10811081
1082- try {
1083- $ database ->updateRelationship (
1084- collection: 'parent ' ,
1085- id: 'children ' ,
1086- newTwoWayKey: 'parent '
1087- );
1088- $ this ->fail ('Failed to throw Exception ' );
1089- } catch (Exception $ e ) {
1090- $ this ->assertEquals ('Related attribute already exists ' , $ e ->getMessage ());
1082+ $ database ->updateRelationship (
1083+ collection: 'parent ' ,
1084+ id: 'children ' ,
1085+ newTwoWayKey: 'parent '
1086+ );
1087+
1088+ $ collection = $ database ->getCollection ('parent ' );
1089+ $ attributes = $ collection ->getAttribute ('attributes ' , []);
1090+ foreach ($ attributes as $ attribute ) {
1091+ if ($ attribute ['key ' ] === 'children ' ) {
1092+ $ this ->assertEquals (null , $ attribute ['options ' ]['twoWayKey ' ]);
1093+ }
10911094 }
10921095 }
10931096
You can’t perform that action at this time.
0 commit comments