【问题标题】:phpunit not working in netbeans 7.2.1phpunit 在 netbeans 7.2.1 中不起作用
【发布时间】:2012-11-29 06:47:58
【问题描述】:

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

我正在使用带有最新 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

但无法克服此错误... 谢谢!

【问题讨论】:

  • 我使用的是同一个版本,但没有任何问题。如果有帮助,请尝试重新安装。
  • 你最近升级你的netbeans了吗?

标签: php netbeans yii phpunit


【解决方案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)

问候, 丹尼

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-02-16
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-09
        • 2013-10-16
        • 2013-01-03
        相关资源
        最近更新 更多