PHPStorm Autocompletetion for PHPUnit Testcase

If you have ever created a PHPUnit Testcase with PHPStorm you probably have noticed that the autocompletion for the interfaces does not work.

To activate autocompletion you have so set the right include path in your PHPStorm settings.

If you are working on Ubuntu your copy of PHPUnit is normaly installed to the following direcoty:

/usr/share/php/PHPUnit/

If you are using a debian based distribution like ubuntu and you have installed PHPUnit with the package manger you can determine the folder by running:

dpkg -L PHPunit

Now you have determined the right path you can add it into PHPStorm:

Goto FILE -> Settings -> Language & Frameworks -> PHP and paste your path

After the automatic reindexing of your include path, PHPStorm shows PHPUnit as External Libary:

Now autocompletion should work in your Testcases:

Fork me on GitHub