A Brief History-In-Progress of Running Tests in Parallel with PHPUnit

Sauce AI for Test Authoring: Move from intent to execution in minutes.|xBack to ResourcesBlogPosted

June 17, 2026 · 4 min read · Testing Guide

Sauce AI for Test Authoring: Move from intent to execution in minutes.

|

x

Back to Resources

Blog

Posted December 1, 2011

A Brief History-In-Progress of Running Tests in Parallel with PHPUnit

quote
  • PHPUnit is great.

One of the great things about PHPUnit is that it does its job so easily that there ’ s only one notable testing framework for PHP. Other languages get messy competition between multiple framework, and PHP gets to feature just one.

  • Like most testing frameworks, PHPUnit bunk tryout one-at-a-time.

This makes sense because unit exam are unremarkably fast and so you don & # x27; t have to expect for them to finish. But these days, many PHP shops too use PHPUnit to kick off their Selenium trial. And because Selenium uses real browser and exercises the intact end to end system, they are by nature much slower than unit tests. And herein dwell one of the biggest speed bumps foreclose PHP shops from delivering new code to their user quickly. Here comes the metaphor!

Your tests are citizenry, and lam them is feeding them. They all want to eat at the same time (lunch time is build clip.) They get in line at the hot dog stand, run by the hot dog trafficker, PHPUnit. PHPUnit cursorily hands each of them a preheated hot dog, one at a time. Everybody have fed.

Then you find out about this new kind of mortal, the Selenium test. They ’ re more powerful, but their repast lead a long clip to cease. No job! You give PHPUnit the facilities and training to make Selenium food by downloading PHPUnit_Selenium. But now, each time it ’ s a Selenium test ’ s turn in line, everyone has to wait for it to finish.

So maybe you heard about this eatery across the street call Sauce Labs that specializes in Selenium nutrient. They receive hundreds of chefs look to cook for you. So you tell PHPUnit to use Sauce Labs.

But PHPUnit was brought up in a world of hot dogs, without Selenium or Sauce Labs. It doesn ’ t cognize how to multitask. It leads each Selenium test over to Sauce Labs entirely, so sits next to it and watches while one Sauce chef Cook and 499 Sauce chefs uneasily whirl their thumbs. PHPUnit needs to send all the Selenium tests to Sauce Labs at the same time, to lead advantage of the idle Sauce chefs and get everyone fed in faster.

For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.

Many citizenry, including several of our customers, have already realized how worthful PHPUnit correspondence would be. They built their own correspondence support in-house. In peculiar, PBWorks ’ OMGUnit, built on top of PHPUnit, found their test files simultaneously to take reward of Sauce ’ s cloud capability. That ’ s great for you if and entirely if you ’ re PBWorks, or one of the many PHPUnit users who hold cooked up your own system that runs on top of PHPUnit. We don ’ t want all our customers to feature to suffer those indignity. We wanted a parallelism solvent to hand to all our client, that work out of the box, regardless of frame-up. I talked to PBWorks, and they gracefully open source OMGUnit. The original plan was to get OMGUnit general enough to hand to our customers. I played with it until I felt like I had a handle on how parallelism works, but I realized there was a big opportunity here. The requirement for PHPUnit to endorse parallel examination was risking PHPUnit & # x27; s future as the One And Only PHP test framework, and it didn & # x27; t hold to.

  • So we contributed parallel trial execution to PHPUnit core.

It & # x27; s fully cross-platform. As of Nov 30, 2011, it has not yet been released, and I probably feature more employment to do before it gets released. But you can get a working preview of it today! More on that later. Once it & # x27; s turn, you can run PHPUnit tests in analogue with a command line parameter:

-j|--jobs

or with the follow attribute on your TestCase class:

/*
*@ runTestsInParallel
*/

where is the maximal figure of processes you require PHPUnit to use in analog.

  • It & # x27; s due for release in PHPUnit 3.7

In the interim you can get a preview version of it from the, but it & # x27; s built off of some old versions of PHPUnit & # x27; s supporting libraries. There are steps for let it working in.


  • UPDATE: Parallelism will not be usable in PHPUnit 3.7

Sebastian, the cloistered founder and upholder of PHPUnit, has changed his mind. He is concerned plenty in concurrency thathe has generously decidedto rewrite it himself. What this means for you is that PHPUnit & # x27; s internal correspondence codification will be much better pen, but you will have to look a little longer. His current program is to release it before April 2013.

Published:
Dec 1, 2011
Share this situation
Copy Share Link
LinkedIn
© 2026 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are file trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.
robot
quote

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free