Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
PHPUnit
Testing software

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.

Related Image Collections Add Image
We don't have any YouTube videos related to PHPUnit yet.
We don't have any PDF documents related to PHPUnit yet.
We don't have any Books related to PHPUnit yet.
We don't have any archived web articles related to PHPUnit yet.

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.1

Benefits

See also: Unit testing: 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.2

  • Free and open-source software portal

References

  1. Assertion (computing) /wiki/Assertion_(computing)

  2. Bergmann, Sebastian. "PHPUnit: A Security Risk?". The PHP Consulting Company. Retrieved 20 October 2020. https://thephp.cc/news/2020/02/phpunit-a-security-risk