1

我环顾四周,找不到任何相关的东西......

我正在使用带有最新 PEAR PHPUnit 的 netbeans 7.2.1。

我不断收到此错误:“无法识别的选项--skeleton-test”

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

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

但无法克服这个错误......谢谢!

4

3 回答 3

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)

问候,丹尼

于 2012-12-23T17:01:15.790 回答
0

好吧。如果你能找到 phpunit.xml,我会检查这个链接是否有同样的问题与解决方案。

于 2012-12-11T17:37:49.730 回答
0

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

于 2012-12-22T15:54:24.227 回答