Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit Command Line Tool Not working

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?

like image 480
Felipe Avatar asked Apr 10 '11 19:04

Felipe


People also ask

How do I run a PHPUnit test case?

How to Run Tests in PHPUnit. You can run all the tests in a directory using the PHPUnit binary installed in your vendor folder. You can also run a single test by providing the path to the test file. You use the --verbose flag to get more information on the test status.

What is PHPUnit phar?

PHP Archive (PHAR) phar and put it into your $PATH as phpunit and that src/autoload. php is a script that sets up autoloading for the classes that are to be tested. Such a script is commonly generated using a tool such as phpab.


1 Answers

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

like image 89
Gordon Avatar answered Sep 23 '22 02:09

Gordon