Install phpunit with CakePHP and Windows
The usual way to install phpunit was through PEAR, however this looks to be deprecated in the future.
There is a .phar package for phpunit, however it’s not immediately clear whether this can be used in combination with CakePHP’s web-runner interface.
Firstly, you need to create a composer.json file in the root directory of your CakePHP application.
The vendors directory is the directory that already exists in CakePHP.
Next you have to install Composer. I’m running this on an Ubuntu with cURL, so it took about 10 seconds. I then moved the executable to a place where it would get picked up by the shell’s path:
Once this is done, you can run composer.phar install in the same directory as your composer.json file, and it will automatically install phpunit and its dependencies into the vendors folder. The final step is to tell CakePHP to include the library using the autoload.php file generated by Composer:
After my colleague had updated his repository, his Windows installation could now run CakePHP’s phpunit web-runner.