These past few days I have been busy hacking on what will become PHPUnit 3.0, hopefully already in January 2006.
The hallmark feature of PHPUnit 3.0 will be its support for Mock Objects. PHPUnit's Mock Object implementation has been initially developed by Jan Borsodi of eZ systems AS and is inspired by jMock.
While working with the Unit Tests for the Zend Framework I noticed that PHPUnit previously had no support for skipping the execution of a test, for instance when a required PHP extension is not available. PHPUnit 3.0 introduces the PHPUnit2_Framework_Assert::markTestSkipped() to mark a test as being skipped.
PHPUnit2_Framework_Assert has been refactored, changes include:
Added assertFileExists(), assertFileNotExists(), assertArrayHasKey(), assertArrayNotHasKey(), assertHasProperty(), and assertHasNotProperty().
Added assertThat() which evaluates arbitrary constraints, based upon the new PHPUnit2_Framework_Constraint infrastructure.
Added getNonPublicProperty() to read non-public properties from objects.
assertContains() and assertNotContains() can now work on strings.
Removed setLooselyTyped().
Changes to the PHPUnit2_TextUI_ResultPrinter (which is part of the command-line test runner) include:
Timings are now sanely formatted as MM:SS.
The summary information (which contains the total number of tests run as well as the number of failures, errors, incomplete and skipped tests) has been cleaned up.
I plan to release an initial beta version after Christmas.