Closed andy-b-84 closed 9 years ago
Are the docs suggesting to use phpunit
or ./vendor/bin/phpunit
?
In http://framework.zend.com/manual/2.3/en/tutorials/unittesting.html , I can read: "As the Zend Framework 2 API uses PHPUnit, so will this tutorial. This tutorial assumes that you already have PHPUnit installed. The version of PHPUnit used should be 3.7.*" Which is the only lead as to which version of PHPUnit one should be using. Well, I used composer to set up my ZF2 project, and I didn't find much documentation on this specific part (composer + ZF2), so I'm not surprised not to find much documentation on how to use PHPUnit + ZF2 + composer :)
This tutorial assumes that you already have PHPUnit installe
Yeah, that's misleading, mainly because nobody used ./vendor/bin/phpunit
at the time the tutorial was written (Sebastian was still arguing that composer was not a good distribution medium).
I tried to launch my Mint's version of PHPUnit, but it couldn't load my project's autoload files.
This resulted in the following error : + 1 :
The only way I found, in order to make PHPUnit use Composer's auto-generated
autoload.php
file, without rewriting the whole Module.php file, was to add phpunit to composer's require-dev dependencies, then use this specific phpunit version to run my tests.