2
votes

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.

3

3 Answers

2
votes

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.

0
votes

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?

0
votes

In command prompt I wrote phpunit instead of php vendor\bin\phpunit and got result.