File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
tests/Tests/ORM/Internal/UnitOfWork Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,31 @@ public function testWillNotBatchOperationsForAGeneratedIdentifierEntity(): void
103103 self ::assertSame (EntityC::class, $ batches [2 ]->class ->name );
104104 self ::assertCount (1 , $ batches [2 ]->entities );
105105 }
106+
107+ public function testWillIsolateBatchesForEntitiesWithGeneratedIdentifiers (): void
108+ {
109+ $ batches = InsertBatch::batchByEntityType (
110+ $ this ->entityManager ,
111+ [
112+ new EntityA (),
113+ new EntityA (),
114+ new EntityC (),
115+ new EntityC (),
116+ new EntityA (),
117+ new EntityA (),
118+ ],
119+ );
120+
121+ self ::assertCount (4 , $ batches );
122+ self ::assertSame (EntityA::class, $ batches [0 ]->class ->name );
123+ self ::assertCount (2 , $ batches [0 ]->entities );
124+ self ::assertSame (EntityC::class, $ batches [1 ]->class ->name );
125+ self ::assertCount (1 , $ batches [1 ]->entities );
126+ self ::assertSame (EntityC::class, $ batches [2 ]->class ->name );
127+ self ::assertCount (1 , $ batches [2 ]->entities );
128+ self ::assertSame (EntityA::class, $ batches [3 ]->class ->name );
129+ self ::assertCount (2 , $ batches [3 ]->entities );
130+ }
106131}
107132
108133class EntityA
You can’t perform that action at this time.
0 commit comments