yii: CTestCase PHPUnit 3.7.10 autoload fails

I know there are some issues about that (phpunit < 3.7.10) and looks like there were solved but, i got this problem, need to notice that problem occures when tests fails: When i run unit tests, Yii::autoloader throws Exceptions on not found files, this files:

PHP_invoker.php, PHPUnit_Extensions_Database_TestCase.php, PHPUnit_Extensions_Story_TestCase.php

on YiiBase::autoload() ...\php\pear\PHPUnit\Util\GlobalState.php:0 So i found that problem again in autoloader order, if i comment spl_autoload_register(array('YiiBase','autoload')); // put yii's autoloader at the end than no exceptions will be thrown by Yii::autoload() even if there is a fail test. But if i run WebTestCase tests Yii autoload throws errors again. So is it my problem or its a Yii bug or phpunit bug? Btw. spl autoloaders list is correct (Yii autoload is the last one). Could it be because of in YiiBase at the end of the file there is already spl_autoload_register(array('YiiBase','autoload')); ?

About this issue

  • Original URL
  • State: closed
  • Created 12 years ago
  • Comments: 61 (17 by maintainers)

Most upvoted comments

@aditya- Please add this line

YiiBase::$enableIncludePath=false;

Somewhere in bootstrap file. For the details you can look into my PR https://github.com/yiisoft/yii/pull/2324

If this not helps: install the PHP_Invoker from PEAR channel.


@Sharom No one here is talking about new projects, right?

My choise is Symfony 2. But now I work with existing project based on Yii.

I understand your feelings. My choice is Rails and I suffered that hard when I had to use Symfony 😃 If you really feel that terrible you just change your job and spam into issues on GitHub.