77use Doctrine \Common \Collections \ArrayCollection ;
88use Doctrine \Common \Collections \Collection ;
99use Doctrine \Common \EventManager ;
10+ use Doctrine \Deprecations \PHPUnit \VerifyDeprecations ;
1011use Doctrine \ORM \EntityNotFoundException ;
1112use Doctrine \ORM \Events ;
1213use Doctrine \ORM \Mapping \ClassMetadata ;
5051 */
5152class UnitOfWorkTest extends OrmTestCase
5253{
54+ use VerifyDeprecations;
55+
5356 /**
5457 * SUT
5558 *
@@ -226,6 +229,9 @@ public function testChangeTrackingNotifyIndividualCommit(): void
226229
227230 $ this ->_unitOfWork ->persist ($ entity );
228231 $ this ->_unitOfWork ->persist ($ entity2 );
232+
233+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8459 ' );
234+
229235 $ this ->_unitOfWork ->commit ($ entity );
230236 $ this ->_unitOfWork ->commit ();
231237
@@ -393,6 +399,8 @@ public function testPersistedEntityAndClearManager(): void
393399 $ this ->_unitOfWork ->persist ($ entity2 );
394400 self ::assertTrue ($ this ->_unitOfWork ->isInIdentityMap ($ entity2 ));
395401
402+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8460 ' );
403+
396404 $ this ->_unitOfWork ->clear (Country::class);
397405 self ::assertTrue ($ this ->_unitOfWork ->isInIdentityMap ($ entity1 ));
398406 self ::assertFalse ($ this ->_unitOfWork ->isInIdentityMap ($ entity2 ));
@@ -414,6 +422,8 @@ public function testEntityChangeSetIsNotClearedAfterFlushOnSingleEntity(): void
414422 $ this ->_unitOfWork ->persist ($ entity1 );
415423 $ this ->_unitOfWork ->persist ($ entity2 );
416424
425+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8459 ' );
426+
417427 $ this ->_unitOfWork ->commit ($ entity1 );
418428 self ::assertEmpty ($ this ->_unitOfWork ->getEntityChangeSet ($ entity1 ));
419429 self ::assertCount (1 , $ this ->_unitOfWork ->getEntityChangeSet ($ entity2 ));
@@ -436,6 +446,8 @@ public function testEntityChangeSetIsNotClearedAfterFlushOnArrayOfEntities(): vo
436446 $ this ->_unitOfWork ->persist ($ entity2 );
437447 $ this ->_unitOfWork ->persist ($ entity3 );
438448
449+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8459 ' );
450+
439451 $ this ->_unitOfWork ->commit ([$ entity1 , $ entity3 ]);
440452
441453 self ::assertEmpty ($ this ->_unitOfWork ->getEntityChangeSet ($ entity1 ));
0 commit comments