13

I run XAMPP on windows.

I've recently downloaded PHPUnit from the PEAR CLI tool.

Everything looks fine, (eclipse correctly suggests code completion so it means that it was correctly added to the include_path),but whenever I try and get it to work via console by typing phpunit (it's in the environmental PATH variable), it hangs on for a seconds or two and then closes( as if it was terminated).

I've tried phpunit --help also, and no success.

Also tried phpunit --verbose.

Has anyone else had that same problem or knows the solution?

3
  • 1
    If you navigate to the phpunit folder and then try and execute phpunit does it work? Commented Apr 10, 2011 at 20:08
  • 1
    PHPUnit instantiates all test cases before it prints out the PHPUnit version and author so it can sometimes seem like it is stalled. Try running it with a single simple test case to make sure it works. As others have said, enable all error reporting. Can you run tests within Eclipse? Commented Apr 10, 2011 at 22:17
  • @jakenoble No it doesn't... @David I'll try that thanks. I didn't know you could do that through eclipse. I'll try that too. Commented Apr 11, 2011 at 1:13

2 Answers 2

32

Make sure your PEAR is up do date:

pear upgrade-all

Do the above until it says nothing to "upgrade-all" then reinstall PHPUnit

pear install --alldeps --force phpunit/PHPUnit

If this doesnt fix the error, make sure you have all error reporting enabled in your php.ini and check your error logs.

If this doesn't work, consider using PHPUnit via Composer or Phar instead of PEAR

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

1 Comment

This didn't help on Debian.
1

For Debian or Ubuntu, add this to your PHP ini file:

suhosin.executor.include.whitelist="phar"

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.