Chapter 16. Extending PHPUnit

PHPUnit can be extended in various ways to make the writing of tests easier and to customize the feedback you get from running them. Here are common starting points to extend PHPUnit.

Subclass PHPUnit2_Framework_TestCase

Write utility methods in an abstract subclass of PHPUnit2_ Framework_TestCase and derive your test-case classes from that class. This is one of the easiest ways to extend PHPUnit.

Get PHPUnit Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.