Jump to content

PHPUnit

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dexbot (talk | contribs) at 03:46, 31 May 2015 (Bot: Remove redundant parameter in official template, handled by Wikidata). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Developer(s)Sebastian Bergmann
Initial release15 March 2004; 21 years ago (2004-03-15)[1]
Stable release
4.4.1 / 28 December 2014; 10 years ago (2014-12-28)[2]
Repository
Written inPHP
Operating systemCross-platform
TypeUnit test
LicenseBSD 3 Clause
Websitephpunit.de

PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit architecture for unit testing frameworks that originated with SUnit and became popular with JUnit. PHPUnit was created by Sebastian Bergmann and its development is hosted on GitHub.

Purpose

PHPUnit was created with the view that the sooner you detect your code mistakes, the quicker you can fix them. Like all Unit testing frameworks PHPUnit uses assertions to verify that behaviour of the unit of code under test behaves as expected.[3]

Benefits

The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. A unit test provides a strict, written contract that the piece of code must satisfy. As a result, unit tests find problems early in the development cycle.

PHPUnit can output test results in a number of different formats, including JUnit XML, Test Anything Protocol, JSON, and TestDox.

References