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?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With