问题
I have been trying to use PHPUnit to test my app, (I installed it via Composer) but when I was trying to execute the tests that I have in my directory called "Tests" in this way:
@myappsite$:php vendor\bin\phpunit Tests
It just printed the content of vendor\bin\phpunit :
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../phpunit/phpunit"
BIN_TARGET="`pwd`/phpunit"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"
Somebody that has ran into this problem before and can help me please. Thanks by advance.
回答1:
Ok, The only problem was with php command, It's not necessary because is not calling a php file but a .bat file. So the thing I gotta do was:
@myappsite$:vendor\bin\phpunit Tests
And it itself runs the php command. I posted this for anybody who maybe has the same problem.
回答2:
It seems that the script is not a php but a bash script, what PHPUnit version is that you were installing..? i.e. what is your composer.json?
回答3:
In command prompt I wrote phpunit
instead of php vendor\bin\phpunit
and got result.
来源:https://stackoverflow.com/questions/23881289/php-vendor-bin-phpunit-is-printing-in-console-a-text