Netbeans, PHPUnit, and You
My love affair with NetBeans continues. The latest discovery in the long list of things to rave about is it’s newly built in (was part of the 6.7 Beta release) support for unit testing with PHPUnit. There is a nice tutorial over on the NetBeans site that gets you up and running with it in no time.
I got done with the tutorial and was stoked to try running unit tests on an existing project from within netbeans, but I quickly hit the wall when I tried running a test:

Figured no prob, I’ll just open the project properties and set the test directory. Hit another wall, that field is read only and won’t let you type in it. After some more playing I finally stumbled across the solution for telling NetBeans about an existing tests directory.
You have to right click on the project and select Test:

After doing that you’ll get the dialog asking where the tests dir is:

Once you set the test dir Netbeans will know where to find you’re tests and you’ll be good go:

That’s all well and good, but what if you ever want to move the test directory? You’re up a against the same problem where the test directory in the project properties box is a read only field. Here are the steps I took to be able to get around this:
- close the project if it is open
- find your nbproject direcotry (in the project root by default)
- pop open the project.properties file inside of the nbproject directory
- look for the line with the test.src.dir variable
- edit the value or remove the line and go through the steps above for telling NB where the test dir is






