phpunitHow to install PHPUnit with Composer?
- Install Composer on your system.
- Create a
composer.json
file in the root of your project and add the following code:
{
"require-dev": {
"phpunit/phpunit": "^7.5"
}
}
- Run
composer install
in the root of your project. - Add the
vendor/bin
directory to yourPATH
environment variable. - Run
phpunit --version
to verify the installation.
Output example
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.
More of Phpunit
- How to skip a PHPUnit test?
- How to mock a method with different arguments in PHPUnit?
- How to ignore a test in PHPUnit?
- How to show warnings in PHPUnit?
- How to mock a static method with PHPUnit?
- How to check if a JSON contains a value in PHPUnit?
- How to test private methods in PHPUnit?
- How to stop PHPUnit on failure?
- How to generate a coverage report with PHPUnit?
- How to install PHPUnit with a PHAR file?
See more codes...