NetBeans中PHPUnit和Selenium的代码完成 [英] Code completion for PHPUnit and Selenium in NetBeans

查看:60
本文介绍了NetBeans中PHPUnit和Selenium的代码完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让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.

  1. 打开工具:选项
  2. 切换到 PHP 标签
  3. 点击全局包含路径框旁边的添加文件夹...
  4. 输入/usr/share/php/PHPUnit或导航到PEAR安装PHPUnit源文件的位置
  5. 点击打开
  6. 点击确定
  1. Open Tools : Options
  2. Switch to the PHP tab
  3. Click Add Folder... next to the Global Include Path box
  4. Enter /usr/share/php/PHPUnit or navigate to where PEAR installed PHPUnit's source files
  5. Click Open
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆