How to install phpunit?
I read documentation https://github.com/sebastianbergmann/phpunit, but have an error:
>pear upgrade PEAR
Nothing to upgrad
As said by @Wilt Installation via pear doesn't works any longer. Follow below steps instead
Step I: Create a directory named bin in C drive.
Step II: Now add the path C:\bin to your environment.
;C:\bin
at the end.Step III: Download phpunit phar file to C:\bin folder.
phpunit.phar
and move it to C:\bin folder.Step IV: Create a batch script phpunit.cmd
Open command prompt. Type cd C:\bin and hit enter.
Then type
echo @php "%~dp0phpunit.phar" %* > phpunit.cmd
and hit enter.
To verify PHPUnit has been installed type phpunit --version
in command prompt. You should get something like PHPUnit x.y.z by Sebastian Bergmann and contributors
.
Reference: https://perials.com/installing-phpunit-windows/