0

I am new to unit testing (and would really like to learn). I tried pulling down this repository (https://github.com/serbanghita/Mobile-Detect) and have been trying to run their unit tests they already have set up. I have it to the point where phpunit is running but when I run

phpunit tests

from the root directory I get:

Tests: 1411, Assertions: 0, Errors: 1411

I have tried running

phpunit --configuration tests/phpunit.xml 

but then I get the error:

 Class "JohnKary\PHPUnit\Listener\SpeedTrapListener" does not exist

They have something in their documentation about running:

php phpunit.phar -c tests/phpunit.xml

but I get the error

Could not open input file: phpunit.phar

which is because of the way I have phpunit set up I'm sure...

Any suggestions on how to further trouble shoot this?

1 Answer 1

2

It appears you have configured https://github.com/johnkary/phpunit-speedtrap to be used as a test listener in your phpunit.xml but have not (properly) installed this extension.

And if your PHP cannot find phpunit.phar then you are either not pointing it to the correct path or you have not downloaded / installed the PHPUnit PHAR, maybe because you chose to install PHPUnit via Composer. In that case the correct path would be vendor/bin/phpunit, of course.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.