Recently, I installed phpunit pear install phpunit/PHPUnit_SkeletonGenerator since I no longer have access to this as part of phpunit. Here is my challenge...for a simple class.
<?phpclass Calculator
{
public function add($a, $B)
{
return $a + $b;
}
}
?>
On the command line, if I run the generator on the above class, you can see that it works.
seal@server:~$ phpunit-skelgen --test Calculator PHPUnit Skeleton Generator 1.1.0 by Sebastian Bergmann. Wrote skeleton for "CalculatorTest" to "/home/seal/CalculatorTest.php".
Now if I were to run the same class within a yii project.
/www/calculator/protected/tests$ phpunit-skelgen --bootstrap bootstrap.php --test ../models/Post.php PHPUnit Skeleton Generator 1.1.0 by Sebastian Bergmann. PHP Warning: include(PHPUnit_Framework_TestCase.php): failed to open stream: No such file or directory in /home/seal/Library/yii/framework/YiiBase.php on line 423
It appears YiiBase::autoload() cannot find the path "PHPUnit/Framework/TestCase.php
Point to note:
- I do have phpunit in the include path for both apache and CLI
- I have also tried to require TestCase directly within the bootstrap.php this works. but then more errors comes up for other files YiiBase::autoload() were unable to find. Also, phpunit have several autoload which makes this approach fruitless.
- I have tried to register the autoload directly, but tis conflicts with yii's autoload.
I welcome any help or suggestions or even questions I can get
Thanks
Attached File(s)
-
Yii_Autoload_PHPUnit_SkeletonGeneration_Fails.png (163.05K)
Number of downloads: 17

Help














