title: Parallel PHPUnit testing in integration tests
body: <p>As the time needed for run complete PHPUnit suite raises, our team starts wondering if there is a possibility to <strong>run Unit tests in parallel</strong>. Recently I read an article about Paraunit, also Sebastian Bergman wrote, he'll add parallelism into PHPUnit 3.7.</p>
  
  <p>But there remains the <strong>problem with integration tests</strong>, or, more generally, tests that interact with DB. For the sake of consistency, the testDB has to be resetted and fixtures  loaded after each test. But in parallel tests there is a problem with race conditions, because <strong>all processes use the same DB</strong>.</p>
  
  <p>So to be able to run integration tests in parallel, <strong>we have to assign own database to each process</strong>. I would like to ask, if someone has some thoughts about how this problem can be solved. Maybe there are already implemented solutions to this problem in another xUnit implementation.</p>
  
  <p>In my team we are using MongoDB, so one solution would be to programmatically create a config file for each PHPUnit process, with generated DB name(for this process), and in <code>setUp()</code> method we could clone the main TestDb into this temporary one. But before we start to implement this approach I would like to ask for your ideas about the topic.</p>