Tutorial :Cygwin and PHPUnit: Could not open input file: /cygdrive/c/xampp/php/phpunit


Is there a way to run PHPUnit from Cygwin? Everytime I run PHPUnit I get this error:

Could not open input file: /cygdrive/c/xampp/php/phpunit  

I am trying to run my unit tests in my Zend Framework App. I am trying to use Cygwin because I am more familiar with *Nix commands (I'm no expert though) rather than Windows.

Thanks, Wenbert


I am having the same problem, I can't get "phpunit" to work by itself, I am using Wamp.

However, I was able to run "phpunit.bat" and it worked for me.

Still can't get the ANSI colors to show up though :(


same problem here, solved it by an alias added to ~/.bash_profile

alias phpunit="/cygdrive/c/xampp/php/php C:/xampp/php/phpunit"


Does /cygdrive/c/xampp/php/phpunit exist? If so what are the permissions on the file?


ls -l /cygdrive/c/xampp/php/phpunit  


Let's use phpunit as dependency and in folder above vendor try:

ln -s vendor/phpunit/phpunit/composer/bin/phpunit phpunit  

It will create for you a symbolic link to real path of phpunit


You could just directly call it by using Windows path in Cygwin:

C:/xampp/php/phpunit --version  

So you could set an alias for ~/.bash_profile:

alias phpunit="C:/xampp/php/phpunit"  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »