2

My book tell to add PHPUnit path to Global Include Path in Netbeans, but its use out of date PEAR way.

I installed PHPUnit using composer global require "phpunit/phpunit xxx". I run this command right in c:\

I got main PHPunit directory in: C:\Users\xxx\AppData\Roaming\Composer\vendor\phpunit

and two files in: C:\Users\xxx\AppData\Roaming\Composer\vendor\bin

1 Answer 1

2

It depends, on how much code-completion support you want.

  • If you want the code-completion to work for all globally installed Composer packages, then the path would be

    C:\Users\xxx\AppData\Roaming\Composer\vendor

    When you set this "Include Path" Netbeans will automatically scan the whole vendor folder and provide completion support for all classes of all packages. Scanning might take a while...

  • If you want completion support only for PHPUnit, then adding

    C:\Users\xxx\AppData\Roaming\Composer\vendor\phpunit

    is sufficent. Only the content of the phpunit folder will be scanned.

    (I use the first approach, because PHPUnit has several other dependencies/packages (e.g. phpunit-selenium) and its nice to have support for these classes, too.)

  • The bin folder should contain a batch file: phpunit.bat. This script might be used in the testing/ phpunit configuration as the "PHPUnit Script". When you invoke testing, this script will be used to start the Composer installed PHPUnit (, instead of the PEAR one).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.