I have been using phpunit plus its related software such as code coverage in yii without a problem.
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, $<img src='http://www.yiiframework.com/forum/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='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:
[list=1][]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.[/list]
I welcome any help or suggestions or even questions I can get
Thanks