I want to simulate LimitException error on StandardSetController which can only return max 10000 records. So I am trying to create a test method which creates more than 10000 records and then try to query them using StandardSetController.
I am trying to insert more than 10000 records in test method across 2 insert statements. Each insert statements in trying to insert around 6000 items. These insert DML statements are not wrapped around Test.StartTest() and Test.StopTest().
But I am getting too many DML rows 10001 error from the test method which tries to insert more tan 10000 item.
My understanding is, it should be possible to insert more than 10000 items as long as they are across multiple DML statements and each DML statement is trying to insert less than 10000 items.
Am I missing something ? How can I simulate this scenario ?