Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get IDE autocomplete for PHPUnit?

I am using Symfony2, everything is installed, my tests work so good so far.

I'd like to get an autocompletion of PHPUnit's methods.

Symfony's WebTestCase class extends from PHPUnit_Framework_TestCase just like below:

abstract class WebTestCase extends \PHPUnit_Framework_TestCase

The parent class is highlighted as not existing although.

How can I tell my IDE to use PHPUnit's library?

I am using PHPStorm
PHPUnit is available by path /Users/myUser/pear/share/pear/PHPUnit/

like image 754
Vitalii Zurian Avatar asked Jul 31 '12 13:07

Vitalii Zurian


3 Answers

Add it as a library... in the project that you are editing add it to 'External Libraries'.

It should then be included.

like image 64
Brian Avatar answered Oct 24 '22 10:10

Brian


For me (Ubuntu 12.04) it was adding this folder as external library:

/usr/share/php/PHPUnit
like image 17
jahller Avatar answered Oct 24 '22 08:10

jahller


For PHPStorm users, go to File -> Settings -> Project Settings ->PHP and add the path in there.

like image 16
Justin Finkelstein Avatar answered Oct 24 '22 10:10

Justin Finkelstein