phpunitHow to install PHPUnit from Packagist?
- Install Composer if you don't have it already.
- Create a
composer.json
file in the root of your project and add the following code:
{
"require-dev": {
"phpunit/phpunit": "^8.5"
}
}
- Run
composer install
in the root of your project. - Add the following line to your
php.ini
file:
zend_extension=xdebug.so
- Run
phpunit
in the root of your project to verify the installation.
You should see the following output:
PHPUnit 8.5.2 by Sebastian Bergmann and contributors.
Usage:
phpunit [options] UnitTest [UnitTest.php]
phpunit [options] <directory>
...
More of Phpunit
- How to show warnings in PHPUnit?
- How to skip a PHPUnit test?
- How to run all PHPUnit tests?
- What are PHPUnit required extensions
- How to install PHPUnit with a PHAR file?
- How to mock a query builder with PHPUnit?
- How to generate a coverage report with PHPUnit?
- How to stop PHPUnit on failure?
- How to run tests in parallel with PHPUnit?
- How to disable color output in PHPUnit?
See more codes...