File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,8 @@ public function commit()
182182 {
183183
184184 $ connection = $ this ->connection ;
185+ $ this ->processed = [];
186+ $ this ->modified = [];
185187
186188 try {
187189 $ connection ->beginTransaction ();
Original file line number Diff line number Diff line change @@ -174,8 +174,32 @@ public function testUoWIntegration()
174174 $ this ->assertEquals ($ foundResult ['username ' ], $ foundUserEntity ->getUsername ());
175175 }
176176
177+ $ firstPost = $ postMapper ->find (['id ' => 1 ]);
178+ /** @var PostEntity $secondPost */
179+ $ secondPost = $ postMapper ->find (['id ' => 2 ]);
180+ $ secondPost ->setContent ('Bam ' );
181+ $ thirdPost = new PostEntity ();
182+ $ thirdPost ->setContent ('FooBar ' );
183+
184+ $ firstUser = $ userMapper ->find (['id ' => 1 ]);
185+ /** @var UserEntity $secondUser */
186+ $ secondUser = $ userMapper ->find (['id ' => 2 ]);
187+ $ secondUser ->setUsername ('Andrew ' );
188+ $ thirdUser = new UserEntity ();
189+ $ thirdUser ->setUsername ('Rudy ' );
190+
191+ $ unitOfWork ->delete ($ firstUser );
192+ $ unitOfWork ->delete ($ firstPost );
193+ $ unitOfWork ->update ($ secondUser );
194+ $ unitOfWork ->update ($ secondPost );
195+ $ unitOfWork ->create ($ thirdUser );
196+ $ unitOfWork ->create ($ thirdPost );
197+
198+ $ unitOfWork ->commit ();
199+
177200 if (true ){
178201
179202 }
203+
180204 }
181205}
You can’t perform that action at this time.
0 commit comments