File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1151,6 +1151,28 @@ public function testDiscardChanges(): void
1151
1151
$ this ->assertEquals ($ oldName , $ contactBean ->getName ());
1152
1152
}
1153
1153
1154
+ /**
1155
+ * @depends testDaoGeneration
1156
+ */
1157
+ public function testDiscardChangesDiscardsRelations (): void
1158
+ {
1159
+ $ countryDao = new CountryDao ($ this ->tdbmService );
1160
+ $ countryBean = $ countryDao ->getById (1 );
1161
+
1162
+ $ oldCount = $ countryBean ->getBoatsByAnchorageCountry ()->count ();
1163
+
1164
+ $ this ->tdbmService ->getConnection ()->insert ('boats ' , [
1165
+ 'name ' => 'RoseBud2 ' ,
1166
+ 'anchorage_country ' => 1 ,
1167
+ 'current_country ' => 1 ,
1168
+ 'length ' => '13.5 ' ,
1169
+ ]);
1170
+
1171
+ $ countryBean ->discardChanges ();
1172
+
1173
+ $ this ->assertEquals ($ oldCount + 1 , $ countryBean ->getBoatsByAnchorageCountry ()->count ());
1174
+ }
1175
+
1154
1176
/**
1155
1177
* @depends testDaoGeneration
1156
1178
*/
You can’t perform that action at this time.
0 commit comments