php vendor\bin\phpunit is printing in console a text

房东的猫 提交于 2019-12-24 03:29:49

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!