NetBeans中PHPUnit和Selenium的代码完成 [英] Code completion for PHPUnit and Selenium in NetBeans
问题描述
如何让NetBeans为PHPUnit类和方法提供代码完成功能?
How can I get NetBeans to provide code-completion for PHPUnit classes and methods?
我已经尝试从 PHPUnit GitHub项目下载,但是我不明白为什么要使用该目录与 Selenium文档.我正在寻找/test/PHPUnit/Extensions/SeleniumTestCase.php
文件的示例.
I have already tried downloading from the PHPUnit GitHub project, but I didn't understand why the directory is different from what's mentioned on the Selenium documentation. I am looking example for the /test/PHPUnit/Extensions/SeleniumTestCase.php
file.
我已经从PEAR安装了PHPUnit,但是现在我需要的是完整的PHPUnit文件,因此可以将其包含在我的IDE中(在本例中为NetBeans).
I have already installed PHPUnit from PEAR, but what I need now is the complete PHPUnit file so I can include it in my IDE (in this case NetBeans).
推荐答案
将PHPUnit目录添加到NetBeans的PHP全局包含路径.这将在NetBeans中为所有项目提供代码完成.
Add the PHPUnit directory to NetBeans's PHP global include path. This will provide code completion in NetBeans for all projects.
- 打开工具:选项
- 切换到 PHP 标签
- 点击全局包含路径框旁边的添加文件夹...
- 输入
/usr/share/php/PHPUnit
或导航到PEAR安装PHPUnit源文件的位置 - 点击打开
- 点击确定
- Open Tools : Options
- Switch to the PHP tab
- Click Add Folder... next to the Global Include Path box
- Enter
/usr/share/php/PHPUnit
or navigate to where PEAR installed PHPUnit's source files - Click Open
- Click OK
更新:安装PHPUnit_Extensions_SeleniumTestCase的文件与PHPUnit放在同一目录中. "noreferrer"> PHPUnit Selenium .
Update: The file defining PHPUnit_Extensions_SeleniumTestCase
is placed in the same directory as PHPUnit when you install PHPUnit Selenium.
例如,PHPUnit_Framework_TestCase
存储在
/usr/share/php/PHPUnit/Framework/TestCase.php
Selenium测试用例存储在
The Selenium test case is stored in
/usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php
因此,通过将/usr/share/php/PHPUnit
放入NetBeans包含路径,您可以同时选择两者.当然,您必须先安装扩展程序.
So by placing /usr/share/php/PHPUnit
into the NetBeans include path, you pick up both. You have to install the extension first, of course.
pear install phpunit/PHPUnit_Selenium
这篇关于NetBeans中PHPUnit和Selenium的代码完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!