phpunit在netbeans 7.2.1中不起作用

时间:2012-12-11 17:03:41

标签: php netbeans yii phpunit

我环顾四周,找不到任何相关内容......

我正在使用netbeans 7.2.1和最新的PEAR,PHPUnit。

我一直收到这个错误:“无法识别的选项--skeleton-test”

我已遵循本指南:http://www.yiiframework.com/forum/index.php/topic/4717-netbeans-68-phpunit-and-yii/

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

但无法通过此错误... 谢谢!

3 个答案:

答案 0 :(得分:1)

经过多次搜索,我编写了以下教程,希望它能帮助其他人:

*** 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)

此致 丹尼

答案 1 :(得分:0)

那么好吧。如果你能找到phpunit.xml,我会检查这个link以解决同样的问题。

答案 2 :(得分:0)

不言而喻,您的设置不正确。首先检查并确保您可以在终端/命令提示符下运行phpunit,以确保您首先正确设置phpunit。一旦确认,我会说你应该参考netbeans文档来设置和使用netbeans中的phpunit http://netbeans.org/kb/docs/php/phpunit.html