New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPUnit can't run #1173
Comments
Looks like the same issue as #1167. As of 4.0, PEAR is simply a distribution channel for our phar. Requiring individual files from PHPUnit will no longer work. And really, since PHPUnit has had an autoloader for quite a while now, there's really no reason for Yii or any other framework to be including these files. |
Thanks! I have downloaded source code of phpunit, and copy some directories and the autoload.php file into lib/php/PHPUnits and rename the file to Autoload.php. |
No problem :) |
Since version 4.0.x PHPUnit will be distributed as a PHAR file via PEAR[1]. This means all the dependencies in form of several files are bundled into one single file. This break any require statements. As you can see at [2], PHPUnit comes with an autoloader which makes any require statement obsolete anyway. This change fixes the error "Warning: require_once(PHPUnit/Framework/TestSuite.php): failed to open stream: No such file or directory in /Volumes/HDD/Users/sok/Development/PHP/PHP_CodeSniffer/tests/TestSuite.php on line 17" [1] https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.0.0#obtaining-phpunit-40 [2] sebastianbergmann/phpunit#1173
PHPUnit is installed by pear install pear.phpunit.de/PHPUnit.
The version is:
$ phpunit --version
PHPUnit 4.0.4 by Sebastian Bergmann.
When a php test is running, it promps as follows:
phpunit unit/MessageTest.php
PHP Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /home/songdragon/Softwares/Dev/apache/apache2/htdocs/yii/framework/test/CTestCase.php on line 11
Warning: require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /home/songdragon/Softwares/Dev/apache/apache2/htdocs/yii/framework/test/CTestCase.php on line 11
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/home/songdragon/Softwares/Dev/apache/apache2/htdocs/demo/protected/components:/home/songdragon/Softwares/Dev/apache/apache2/htdocs/demo/protected/models:/home/songdragon/Softwares/Dev/PHP/php/lib/php') in /home/songdragon/Softwares/Dev/apache/apache2/htdocs/yii/framework/test/CTestCase.php on line 11
Fatal error: require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/home/songdragon/Softwares/Dev/apache/apache2/htdocs/demo/protected/components:/home/songdragon/Softwares/Dev/apache/apache2/htdocs/demo/protected/models:/home/songdragon/Softwares/Dev/PHP/php/lib/php') in /home/songdragon/Softwares/Dev/apache/apache2/htdocs/yii/framework/test/CTestCase.php on line 11
The text was updated successfully, but these errors were encountered: