Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans, code completion for PHPUNit not working. (Windows)

I've followed these steps to get PHPUnit working in NetBeans in windows:

  1. Download PHPUnit.phar and save to c:\phpbin
  2. Follow instructions under the Windows heading here
  3. Set up PATH variables and NetBeans global/project settings

Everything's working, except I don't have code completion working for PHPUnit. For example, if I type:

$this->asser

I would expect it to show a list of the various assert statements. But it doesn't.

I tried following this guide to get it working, but I don't know where the PHPUnit source files are, so I cannot add it to NetBean's PHP Global Include Path as per the instructions.

Where are the source files? Or is there another way for autocompletion to be correctly configured?

Thanks

like image 464
CL22 Avatar asked Jul 14 '15 12:07

CL22


1 Answers

You should have the PHP Windows installation. When I last did this using PEAR (which is deprecated) PHPUnit was installed under the root of the PHP web server. I would bet that PHAR puts it in the same place.

Once that is done, you typically have to set up a bootstrap that tells Netbeans where to look for executables, directories and such. Oddly enough the Netbeans tutorial doesn't mention that you have to extend the PHPUnit class for your test. That should give you the autocomplete you seek.

class ClassTest extends PHPUnit_Framework_TestCase {

}
like image 157
Machavity Avatar answered Nov 11 '22 19:11

Machavity