Skip to main content
Image for post: PHPStorm and PHPUnit autocomplete

PHPStorm and PHPUnit autocomplete

Configuring PHPUnit on PHPStorm IDE

To work with PHPUnit without autocomplete is almost impossible and sometimes PHPStorm doesn't show it. We must ensure we have enabled the IDE to see where PHPUnit is installed. I use the phar file. Since when  they have removed the PEAR installation, we have to install PHPUnit with the phar file. So download the phar file and put it on c:\bin. Follow the instruction to install PHPUnit on your operative system. If you have installed PHPUnit successfully you must tell PHPStorm to recognize the phar file. File -> Settings -> Languages & Frameworks -> PHP Configure the interpreter. And now on the same tab: File -> Settings -> Languages & Frameworks -> PHP -> PHPUnit  Select Path to phpunit.phar clicking on the radio button, the path where you have the phar file (c:\bin) and apply. Now you will be able to see the autocomplete on your test files. I'm using PHPStorm 8.0.3 so this short guide is made using this version.