Error ‘php.exe’ is not recognized as an internal or external command when calling phpunit on Windows XP/Vista/7

This may be caused by the PHP_PEAR_PHP_BIN environment variable not being set correctly.

To fix this go to Advanced System Settings in Control Panel/System & Maintenance/System.

Select Environment Variables.

Find variable PHP_PEAR_PHP_BIN and change the value from ./php.exe to the correct path\to\php.exe on your system.

References:
PHPUnit ignores pathing to php.exe on Windows for PHPT executions
php_pear_php_bin is not set correctly