Typically you run a batch non-progressively like this:
batch_set($batch);
$batch = &batch_get();
$batch['progressive'] = FALSE;
batch_process();
But this does not work when running inside a SimpleTest. At least for SimpleTest via the UI, it runs in a batch itself. So messing with batch_set() and batch_get() here causes the SimpleTest batch runner to lose itself. Thankfully with one method we can easily run a batch from inside a SimpleTest:
public function runBatch(array $batch) {
$existing_batch = batch_get();
$current_batch = &batch_get();
if ($existing_batch) {
$current_batch = NULL;
}
batch_set($batch);
$current_batch['progressive'] = FALSE;
batch_process();
if ($existing_batch) {
$current_batch = $existing_batch;
}
}