Skip to main content

Glossary P

Glossary · Cross-cutting

PHPUnit

Area
Both strands
Related
PHPStan, Non-GxP, QA

PHPUnit is an open-source testing framework for PHP that developers use to write automated tests comparing actual results with expected ones.

A test, in PHPUnit terms, is code that checks whether other code behaves as expected. Technically, each test is a public method of a test class, in which checks called assertions compare an actual value with the expected one. The PHPUnit manual counts a test as passed when none of its assertions fail, all its expectations are met and no unexpected exception is thrown. One goal of PHPUnit is that any number or combination of tests can be run together, up to every test in a project; for this, tests are grouped into a test suite.

PHPUnit calls itself a programmer-oriented testing framework for PHP that follows the xUnit architecture for unit testing frameworks. It is released under the BSD 3-Clause licence, with Sebastian Bergmann as copyright holder. Static analysis tools such as PHPStan complement the tests.

Automated tests are how we check that a change does not quietly break something that already works. They run after every change and before every update, and we keep adding to them. On a knowledge platform we look after for a logistics provider in the pharmaceutical industry, for example, PHPUnit tests cover individual components, the way they work together and complete features.

Where the term appears

Sources

  1. README des Repositorys sebastianbergmann/phpunit (Branch main) (opens in a new tab)

    Sebastian Bergmann (GitHub sebastianbergmann/phpunit) accessed

  2. PHPUnit 13.4 Manual, 2. Writing Tests for PHPUnit (opens in a new tab)

    PHPUnit (docs.phpunit.de) accessed

  3. LICENSE des Repositorys sebastianbergmann/phpunit (Branch main) (opens in a new tab)

    Sebastian Bergmann (GitHub sebastianbergmann/phpunit) accessed

  4. PHPUnit 13.4 Manual, Organizing Tests (opens in a new tab)

    PHPUnit (docs.phpunit.de) accessed

Let's talk about your project.

If this term is on your desk right now, a conversation usually helps faster than any definition.

Search the website

Popular topics

All results