PHPUnit
![]() | |
Developer(s) | Sebastian Bergmann |
---|---|
Initial release | 27 November 2001; 22 years ago (2001-11-27)[1] |
Stable release | 10 / 3 February 2023; 18 months ago (2023-02-03)[2] |
Repository |
|
Written in | PHP |
Operating system | Cross-platform |
Type | Unit testing framework |
License | BSD 3 Clause |
Website | phpunit |
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 is based on the idea that developers should be able to find mistakes in their newly committed code quickly and assert that no code regression has occurred in other parts of the code base. Much like other unit testing frameworks, PHPUnit uses assertions to verify that the behavior of the specific component - or "unit" - being tested 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 and TestDox.
Vulnerabilities
A vulnerability that allowed attackers to execute remote code via PHPUnit was discovered in late 2017. By sending a payload of PHP code to a file that is part of PHPUnit, an attacker could execute PHP code on the webserver.[4]
References
External links
- Official website
- v
- t
- e
![](http://upload.wikimedia.org/wikipedia/commons/thumb/2/27/PHP-logo.svg/64px-PHP-logo.svg.png)
- Accelerator (List)
- Composer
- Editors
- Libraries
- PEAR
- HHVM
- HPHPc
- Parrot
- PeachPie
- Phalanger
- Quercus
- Zend Engine
- CakePHP
- CodeIgniter
- Drupal
- eZ Publish
- Fat-Free
- Flow
- FuelPHP
- Grav
- Gyroscope
- Horde
- Joomla!
- Laminas
- Laravel
- li₃
- Midgard
- MODX
- Nette
- Phalcon
- PHP-Fusion
- PHP-Nuke
- Pop PHP
- PRADO
- ProcessWire
- Qcodo
- Silverstripe
- Symfony
- TYPO3
- WordPress
- XOOPS
- Yii
- Behat
- PHPUnit
- Doctrine
- Aptana
- Codelobster
- Eclipse PDT
- NetBeans
- PHPEdit
- PhpStorm
- Zend Studio
Category
Commons