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
@@ -389,6 +395,8 @@ public function testPersistedEntityAndClearManager(): void
389395 $ this ->_unitOfWork ->persist ($ entity2 );
390396 self ::assertTrue ($ this ->_unitOfWork ->isInIdentityMap ($ entity2 ));
391397
398+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8460 ' );
399+
392400 $ this ->_unitOfWork ->clear (Country::class);
393401 self ::assertTrue ($ this ->_unitOfWork ->isInIdentityMap ($ entity1 ));
394402 self ::assertFalse ($ this ->_unitOfWork ->isInIdentityMap ($ entity2 ));
@@ -410,6 +418,8 @@ public function testEntityChangeSetIsNotClearedAfterFlushOnSingleEntity(): void
410418 $ this ->_unitOfWork ->persist ($ entity1 );
411419 $ this ->_unitOfWork ->persist ($ entity2 );
412420
421+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8459 ' );
422+
413423 $ this ->_unitOfWork ->commit ($ entity1 );
414424 self ::assertEmpty ($ this ->_unitOfWork ->getEntityChangeSet ($ entity1 ));
415425 self ::assertCount (1 , $ this ->_unitOfWork ->getEntityChangeSet ($ entity2 ));
@@ -432,6 +442,8 @@ public function testEntityChangeSetIsNotClearedAfterFlushOnArrayOfEntities(): vo
432442 $ this ->_unitOfWork ->persist ($ entity2 );
433443 $ this ->_unitOfWork ->persist ($ entity3 );
434444
445+ $ this ->expectDeprecationWithIdentifier ('https://github.com/doctrine/orm/issues/8459 ' );
446+
435447 $ this ->_unitOfWork ->commit ([$ entity1 , $ entity3 ]);
436448
437449 self ::assertEmpty ($ this ->_unitOfWork ->getEntityChangeSet ($ entity1 ));
0 commit comments