The image shows several people working together to assemble a puzzle made up of yellow pieces that form the shape of a light bulb. The light bulb typically symbolises an idea or innovation. The scene takes place on a wooden table, which also holds a cup of coffee, a glass of water, an open laptop and some documents. The people's hands are visible as they fit the puzzle pieces together, illustrating collaboration and teamwork.

This article was originally sent as a newsletter to my subscribers on August 1, 2025. See the end of this article for details.

Collaborative Innovation

Over the past few weeks, I have had the pleasure of leading two exciting training courses: "Advanced PHPUnit" and "Test-Driven Development". The former focused on successful test automation in everyday project work, including solutions for particularly challenging problems. The second training covered software development using the proven test-driven development (TDD) workflow.

A particular highlight of both training courses was the close collaboration with all participants. Together, we identified specific requirements for new PHPUnit features that would further enhance the efficiency of automated testing.

Between workshops, I implemented the features that had been discussed and then tested them with the groups during the next workshop. Feedback from participants was fed straight back into the development process.

Test Suite Bootstrapping

Since at least 2019, I had wanted to implement support for test suite-specific bootstrap scripts. However, I had not dared attempt an implementation until now, as I feared unintended side effects. When the topic came up during my recent "Advanced PHPUnit" training, however, one of the participants suggested an approach that I felt was safe to try.

This approach is explained in the specification for the new feature and in the documentation.

Custom TestDox Formatting

Automated tests verify more than just whether code works correctly. When written well, they serve as an executable specification before the code they exercise is written, and as executable documentation once the production code exists. PHPUnit's TestDox functionality supports this, particularly in test-driven development.

While collaborating on the development of software in an Ensemble Programming style during my recent "Test-Driven Development" training, we discovered that the existing support offered by PHPUnit for customising TestDox output using the #[TestDox] attribute and placeholders was insufficient to produce the desired output for one of the tests we had written. This gave rise to the idea of introducing the #[TestDoxFormatter] attribute, which configures a method invoked with data from the data provider to generate fully customised TestDox output.

You can find an example showing how to use the #[TestDoxFormatter] attribute in the documentation.

The result of this collaboration is something we can all be proud of. The new features mentioned above and other useful improvements are now officially part of PHPUnit 12.3! All PHPUnit users can now benefit from these practical enhancements based on real-world project scenarios.

Exclusive Insights Delivered to Your Inbox

Coinciding with each PHPUnit feature release every two months, I deliver a comprehensive analysis of new features, implementation details, and the strategic reasoning behind every enhancement directly to subscribers. It's more than just a ChangeLog: it's your gateway to understanding how cutting-edge testing capabilities can transform your development workflow.

I publish the content of the newsletter here on this website a month after my subscribers have received it. Subscribe now to ensure you receive valuable information about PHPUnit as soon as possible.