[Solved]PHPUnit Could not open input file – Two Solutions

Error Message: Could not open input file: .\pear\PHPUnit2\TextUI\TestRunner.php
Scence: run command: phpunit xxxTest
PHP Env: xampp 1.7.1 version

Solution One:
When you run the command phpunit xxxTest, there are some files you need to pay attention to:
1. xampp\php\phpunit.bat (code “”\xampp\php\.\php.exe” “.\pear\PHPUnit2\TextUI\TestRunner.php” %*”)

fix method: you can modify the code according to your installation path
“C:\xampp\php\php.exe” “C:\xampp\php\PEAR\PHPUnit2\TextUI\TestRunner.php” %*

Solution Two:
Related file: xampp\php\phpunit.bat and xampp\php\phpunit(this is a php file without php extension name)

xampp\php\phpunit code as
==================================================
require ‘PHPUnit2/TextUI/TestRunner.php’;
==================================================

xampp\php\phpunit.bat code as
==================================================
if “%PHPBIN%” == “” set PHPBIN=D:\xampp171\php\.\php.exe
if not exist “%PHPBIN%” if “%PHP_PEAR_PHP_BIN%” neq “” goto USE_PEAR_PATH
GOTO RUN
:USE_PEAR_PATH
set PHPBIN=%PHP_PEAR_PHP_BIN%
:RUN
“%PHPBIN%” “D:\xampp171\php\phpunit” %*
==================================================

I think you must fix your problem now.