1
votes

I've looked around and couldnt find anything relevant...

I'm using netbeans 7.2.1 with the latest PEAR, PHPUnit.

I keep getting this error: "unrecognized option --skeleton-test"

i've followed this guide: http://www.yiiframework.com/forum/index.php/topic/4717-netbeans-68-phpunit-and-yii/

and: http://netbeans.org/kb/docs/php/phpunit.html

but can't get past this error... thanks!

3
I am using the same version, but did not have any problem with it. Try re-installing it, if it helps. - samayo
Did you upgrade your netbeans recently? - samayo

3 Answers

1
votes

After many many many searches i wrote the following tutorial, hope it will help others:

*** phpunit via PEAR: ***
----------------
SELENIUM FOR FUNCTION TESTING (not mendatory)
A. pear install --force phpunit/PHPUnit_Selenium
B. http://www.phpunit.de/manual/3.1/en/selenium.html

PHPUnit + Selenium: (http://amiworks.co.in/talk/installing-pear-and-phpunit-on-wamp-and-windows-7/)
A. pear upgrade pear
B. pear channel-discover components.ez.no 
C. pear channel-discover pear.phpunit.de
D. pear channel-discover pear.symfony.com //+ pear channel-discover pear.symfony-project.com
E. pear install --alldeps pear.phpunit.de/PHPUnit
F. pear install phpunit/PHPUnit_SkeletonGenerator
G. pear install phpunit/PHPUnit_Selenium

In NETBEANS:

    A. Tools --> Options --> PHP --> Unit Test --> Add PHPUnit + Skeleton
    B. Right click on the project --> properties --> PHPUnit --> 
        B1. Browse to bootstrap + XML and Genereate to tests folder
        B2. update the generated bootstrap with Yii (from original bootstrap)

*** UPDATE bootstrap: (PHPUnit >3.6):
    add "require_once( Yii::getPathOfAlias('system.test.CTestCase').'.php' );" after "require_once($yiit);"
*** UPDATE Yii Framework CTestCase.php (PHPUnit >3.6):
    require_once('PHPUnit/Runner/Version.php');
    require_once('PHPUnit/Autoload.php');

*** In case of errors make sure php.ini under php folder is not missing configuration (should have the same as php.ini under Apache in WAMP)

Regards, Danny

0
votes

Well then. if you can find, the phpunit.xml, I would check this link for the same problem with solution.

0
votes

It goes without saying that you have something incorrectly setup. First check and make sure you can run phpunit in the terminal / command prompt to ensure you have phpunit setup correctly in the first place. Once confirmed, I would say you should reference the netbeans documentation for setting up and using phpunit in netbeans http://netbeans.org/kb/docs/php/phpunit.html