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 show warnings in PHPUnit?
- How to skip a PHPUnit test?
- How to mock a method with different arguments in PHPUnit?
- How to log to the console with PHPUnit?
- How to install PHPUnit with a PHAR file?
- How to test private methods in PHPUnit?
- What are PHPUnit required extensions
- How to order tests with PHPUnit?
- How to mock a static method with PHPUnit?
- How to use a listener with PHPUnit?
See more codes...