Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Purpose  





2 Benefits  





3 Vulnerabilities  





4 References  





5 External links  














PHPUnit






Čeština
Deutsch
Español
Français


Polski
Português
Türkçe
Українська
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Developer(s)Sebastian Bergmann
Initial release27 November 2001; 22 years ago (2001-11-27)[1]
Stable release

10 / 3 February 2023; 17 months ago (2023-02-03)[2]

Repository
Written inPHP
Operating systemCross-platform
TypeUnit testing framework
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[edit]

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[edit]

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[edit]

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[edit]

  1. ^ "PHP: Revision 63330". svn.php.net.
  • ^ "Releases · sebastianbergmann/phpunit". GitHub.
  • ^ Assertion (computing)
  • ^ Bergmann, Sebastian. "PHPUnit: A Security Risk?". The PHP Consulting Company. Retrieved 20 October 2020.
  • External links[edit]


    Retrieved from "https://en.wikipedia.org/w/index.php?title=PHPUnit&oldid=1227778037"

    Categories: 
    Extreme programming
    PHP frameworks
    Unit testing frameworks
    Software using the BSD license
    Hidden categories: 
    Articles with short description
    Short description is different from Wikidata
     



    This page was last edited on 7 June 2024, at 18:59 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki