Phpunit Phar

I installed PHPUnit in the phar format as seems to be the recommended method on their site. This package comes with all of the dependencies and extra packages bundled into a single file.

When trying to run unit tests through Yii, the following require_once lines are causing errors, because the files don’t exist:





require_once('PHPUnit/Util/Filesystem.php'); // workaround for PHPUnit <= 3.6.11


This applies to Yii 1.1.14 and the current development version.

Could this be avoided by simply checking if those classes are already defined before using require_once?

I’ve commented out those lines as a short term workaround.


When trying to perform an assertion, I got another warning from Yii’s autoloader:

PHP Warning:  include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory in /home/keith/Dev/Web/Yii/framework/YiiBase.php on line 427

I’ve turned off error reporting for now. as the failed inclusions don’t prevent the tests from running.

Shall I put this in the bug tracker? I’m assuming it’s a legitimate bug as nobody’s told me I’m stupid yet. :P