Sadly, all of the previous answers use deprectaed code.
If you are looking for a newer vesion, there is this post about it : Replace PHPUnit method `withConsecutive` (abandoned in PHPUnit 10)