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 skip a PHPUnit test?
- How to run tests in parallel with PHPUnit?
- How to use hooks in PHPUnit?
- What are PHPUnit required extensions
- How to use the PHPUnit Framework TestCase?
- How to run PHPUnit in quiet mode?
- How to show warnings in PHPUnit?
- How to load fixtures with PHPUnit?
- How to use a listener with PHPUnit?
- How to stop PHPUnit on failure?
See more codes...