Code completion for PHPUnit and Selenium in NetBeans

后端 未结 2 883
广开言路
广开言路 2021-02-01 08:50

How can I get NetBeans to provide code-completion for PHPUnit classes and methods?

I have already tried downloading from the PHPUnit GitHub project, but I didn\'t unders

2条回答
  •  南旧
    南旧 (楼主)
    2021-02-01 09:43

    Add the PHPUnit directory to NetBeans's PHP global include path. This will provide code completion in NetBeans for all projects.

    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

    Update: The file defining PHPUnit_Extensions_SeleniumTestCase is placed in the same directory as PHPUnit when you install PHPUnit Selenium.

    For example, PHPUnit_Framework_TestCase is stored in

    /usr/share/php/PHPUnit/Framework/TestCase.php
    

    The Selenium test case is stored in

    /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php
    

    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
    

提交回复
热议问题