Manual:PHP unit testing

Unit testing in MediaWiki is performed using the PHPUnit framework, a PHP rendition of JUnit. This document serves to prescribe a set of best practices for writing and organizing unit tests for MediaWiki core and extension software.

Before contributing to this document, please be sure you have read through the documentation on how to write and organize tests. Developers should avoid inventing new conventions or borrowing conventions from other frameworks; using the already well-established PHPUnit conventions will serve to make MediaWiki's tests both useful and usable.

Status
Work has been done to reorganize PHPUnit tests located in /maintenance/tests into a properly organized directory tree which mirrors the sources of the units under test. This work can be seen in the phpunit-restructure branch.