Phpunit only shows help / usage information, no testresult

After some problems installing phpunit (manually at the end) on wamp and windows 7, it starts now, but only the usage information that you see only when you enter phpunit is displayed.

No matter which directory I am in, no matter in which directory I specify phpunit, or in which file, I get usage information.

It does not matter if Wamp works or not, the output remains unchanged. The files I use are similar to the following: http://blogs.sitepoint.com/2010/12/16/tutorial-introduction-to-unit-testing-in-php-with-phpunit/

Regards, Maaike

+4
source share
2 answers

PHPUnit has nothing to do with the web server. This is a tool that uses the PHP-CLI, you call it from the command line. If PHP-CLI is installed (it can be part of WAMP or XAMP), then installing PHPUnit should not be a difficult task. The simplest is to install the entire Composer system - explained, for example, here

If you tried to install PEAR before you can unistall it pear uninstall phpunit/PHPUnit

To test PHP-CLI, just try php -v at the command line, make sure php dir is on the system path.

To check PHPUnit just try phpunit --version

+1
source

There can be a lot of problems with phpunit if you do not install it from a pear, but from a hand. Without a more detailed conclusion, I have no idea.

My advice is just to use a pear. I know there are problems, but try

 pear update pear pear channel-update pear.phpunit.de pear install --force --alldeps phpunit/PHPUnit 

It works for more than 90% of the people I talked to, and they have a problem when phpunit runs on windows.

If for some reason this does not solve your problem, please comment and I will try to find another solution. (Perhaps you can add some console exit messages / error messages)

0
source

Source: https://habr.com/ru/post/1341777/


All Articles