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



Question:

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


Solution:1

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 :(


Solution:2

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

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


Solution:3

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

Try

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


Solution:4

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


Solution:5

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
Previous
Next Post »