phpunitHow to install PHPUnit with Composer?
- Install Composer on your system.
- Create a
composer.jsonfile in the root of your project and add the following code:
{
"require-dev": {
"phpunit/phpunit": "^7.5"
}
}
- Run
composer installin the root of your project. - Add the
vendor/bindirectory to yourPATHenvironment variable. - Run
phpunit --versionto 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 stop PHPUnit on failure?
- How to run tests in parallel with PHPUnit?
- How to skip a PHPUnit test?
- How to mock a static method with PHPUnit?
- How to mock a method with different arguments in PHPUnit?
- How to generate a JUnit report in PHPUnit?
- How to run all PHPUnit tests?
- How to mock a method with PHPUnit?
- What are PHPUnit required extensions
See more codes...