DarkCowboy
DarkCowboy

Reputation: 141

phpunit command return "phpunit --help" screen

I'm trying to make some PhpUnit test on Magento with using ecomdev (https://github.com/EcomDev/EcomDev_PHPUnit).

I've correctly installed modman, PEAR and related packages dependencies (I'm on Ubuntu server 12.04 through a Virtualbox).

What is really strange is, after the step 2, from ecomdev procedure, when I'm trying to start a first "$ phpunit" command, it shows the screen as if I typed "$ phpunit --help".

When I type "$ phpunit --version" it correctly displaying the current version (mean it seems correctly installed).

All advices are welcome.

Upvotes: 0

Views: 274

Answers (2)

Alexandr Nizhnik
Alexandr Nizhnik

Reputation: 31

I have been similar problem on WAMP, WinXP SP3, Apache 2.4, PHP5.4.44, Xdebug v2.3.3, vc10+vc14

I downloaded phpunit.phar from phpunit.de My error was wrong phpunit.cmd file.

I wrote @php "%~dp0phpunit.phar"

Correct cmd is @php "%~dp0phpunit.phar" %*

Upvotes: 1

ScottYoumans
ScottYoumans

Reputation: 48

phpunit needs to know what to run. EcomDev_phpUnit includes a phpunit.xml.dist file that phpunit can use. Neither modman nor modgit installs it in Magento's root by default. You can copy the default version into Magento's webroot from the module's source folder or by installing the module manually.

I used modgit to install EcomDev_phpUnit. Here is the copy command I used to copy the file:

cp .modgit/ecomdev_phpunit/source/phpunit.xml.dist .

Once in place, phpunit should give you something like this:

$ phpunit
PHPUnit 3.7.28 by Sebastian Bergmann.

Configuration read from /path/to/your/magento/phpunit.xml.dist

There is likely a more correct way to use the included ecomdev-phpunit.php script to copy the phpunit.dist.xml file into place.

Upvotes: 0

Related Questions