0

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.

DarkCowboy
  • 141
  • 6
  • What do you want from `$ phpunit` command? – sectus Nov 22 '13 at 00:27
  • ur question is not clear. if you type only phpunit than there will always be help screen. thats how it is. and if you wanna run the tests than do :eg:/Desktop/phpunit_selenium$ phpunit myfile.php – Arpan Buch Nov 22 '13 at 05:48
  • Thank you for your answers. You'll find what I want from simple "phpunit" command on "step 3" from the installation procedure from the link in my first post. – DarkCowboy Nov 22 '13 at 09:34

2 Answers2

1

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" %*

0

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.