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 run tests in parallel with PHPUnit?
- How to log with PHPUnit?
- How to assert that key exists in an array using PHPUnit?
- How to clear the PHPUnit cache?
- How to increase memory limit in PHPUnit?
- How to load fixtures with PHPUnit?
- How to mock a private method in PHPUnit?
- How to disable deprecation notices in PHPUnit?
- How to use the PHPUnit cache?
See more codes...