Unit testing framework: PHPUnit 10 requires version 8 of the programming language

Version 10 of the PHP testing framework PHPUnit should actually have been available in February 2021. In an interview with heise Developer, Sebastian Bergmann explains why the release is still pending and what developers can expect from PHPUnit 10. Sebastian Bergmann is not only maintainer of the framework, but also co-founder and principal consultant of The PHP Consulting Company (thePHP.cc).

heise Developer: PHPUnit 10 should appear in February 2021. Why is the update taking longer than planned?

Sebastian Bergmann: That’s right: As has been the case for years, a new major version of PHPUnit should have appeared on the first Friday in February 2021. Such an update provides an opportunity to clean up every year. New functionality is mostly implemented in minor versions, for example in PHPUnit 10.1 to PHPUnit 10.5, which appear on the first Friday in April, June, August, October and December. Unfortunately, we were unable to fulfill this plan this time.

Before the pandemic, I mostly worked on open source while traveling: on a plane, on a train, at the airport or in a hotel. That was a win-win situation because working on open source helped me bridge the gap – for example on a long-haul flight. Before the pandemic, I worked almost exclusively on site for our (thePHP.cc) customers. That is, when I got home, I was at home, not at work. I’ve always been home since the pandemic, which is nice. But I’m always at work, which is not always nice. I’m getting better and better at dealing with these changes. But for at least a while during the pandemic, I just couldn’t muster the energy to work on open source. In order to find this energy again, regular video meetings and mob programming with Andreas Möller, Ewout Pieter den Ouden and Arne Blankerts were very important to me.

Before the pandemic, we started at a hackathon organized by the European Union to develop a new system for expanding PHPUnit. The work on this event system was largely driven by Arne Blankerts and Andreas Möller. It quickly became clear to us that we absolutely wanted this system in PHPUnit 10. Due to the pandemic and its effects on all of our lives and work, the development of the event system has unfortunately taken longer than originally thought.

heise Developer: What is the current state of development? When do you plan to release the 10th major version?

Miner: The already mentioned new event system for expanding PHPUnit was merged some time ago into the development branch for PHPUnit 10. According to the tried and tested principle of “Eat your own dog food”, we are currently working on the PHPUnit-internal code, which has so far been the TestListenerInterface and the ResultPrinterClasses, revised to use the event system instead. By forcing ourselves to use events both for console output and for writing log files, we discover missing or ambiguous events at an early stage. The work on the event system affected the entire code base. In this way we were finally able to pay off a lot of technical debts. The search for the right places to trigger the appropriate events has uncovered countless previously hidden inconsistencies and problems. Ultimately, we invested significantly more work and time in tidying up and improving the implementation of PHPUnit for PHPUnit 10. This will pay off in the long term for everyone: for those who work on PHPUnit as well as for those who develop extensions for PHPUnit such as Infection or Pest.

In addition, a lot of work was necessary to support new PHP features such as union types or intersection types in current PHPUnit versions and to make older PHPUnit versions compatible with new PHP versions. For the latter, there is now so-called life support: Changes to an otherwise unsupported version of PHPUnit are made to make them compatible with new versions of the programming language, as long as this is feasible.

I hope to be able to release PHPUnit 10 on February 4th, 2022. However, I can only promise to try very hard. I can’t promise that the new version will be ready by then. At the end of the day, “it’s ready when it’s ready” still applies.

To home page