ExUnit vs PHPUnit
ExUnit
hexdocs.pmPHPUnit
phpunit.deSide by side
| Figure | ExUnit | PHPUnit |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Windows | — | Yes |
| macOS | — | Yes |
| Linux | Yes | Yes |
| Self-hosted | — | Yes |
| Plans published | 1 | 1 |
| Spec score · Unit Testing Frameworks | 8.3 (#4) | 8.3 (#5) |
| Spec score · Unit Testing | 8.2 (#6) | 8.4 (#2) |
| Assertions | ExUnit.Assertions provides macros that generate assertions with appropriate error messages. | The manual documents assertions for values, exceptions, side effects, output, files, JSON, and XML. |
| Purpose | ExUnit is a unit testing framework for Elixir. | PHPUnit is a testing framework for PHP. |
| Test assertions | ExUnit.Assertions provides macros that generate assertions with appropriate error messages. | The manual covers tests for return values, exceptions, side effects, output, and error log output. |
| Test execution | ExUnit starts tests and can run them automatically before the VM terminates. | PHPUnit provides a command-line test runner for running tests and selecting test suites. |
Plans
In their own words
PHPUnit
PHPUnit is a free testing framework for PHP, with a command-line runner for running tests and selecting test suites. It covers assertions for return values, exceptions, side effects, output, files, JSON, XML, and error-log output. Tests can be organized through filesystem structure or XML configuration and can use data providers, dependencies, stubs, and mock objects. The framework documents code coverage reports in HTML and JSONL formats, plus JUnit and TeamCity logging configuration. For tests that fail intermittently, PHPUnit supports repeating and retrying runs through attributes and command-line options. Installation is available as a PHAR or as a Composer development dependency. PHPUnit 13 is the current stable major version and requires PHP 8.4 or later. Bug-fix support for that version runs through February 4, 2028; its end-of-life date is undetermined. Documentation is available for versions 8.5 through 13.4. PHPUnit supports Linux, macOS, Windows, and self-hosted use.