Netbeans 8.0.1 with PHPUnit generator and skeleton
I've installed Netbeans along with PHPUnit
and phpunit-skeleton-generator
from homebrew. I can generate a test file from terminal by running phpunit-skelgen --test -- "UrlDecoder" classes/UrlDecoder.class.php
, however Netbeans refuses when I right click on the file, select tools
> Create tests
. This is the error I am getting:
And this is the output from the log:
"/usr/local/opt/php55/bin/php" "/usr/local/bin/phpunit-skelgen" "--ansi" "generate-test" "--bootstrap=/Users/paulp/Sites/fortv/tests/bootstrap.php" "UrlDecoder" "/Users/paulp/Sites/fortv/classes/UrlDecoder.class.php" "UrlDecoderTest" "/Users/paulp/Sites/fortv/tests/classes/UrlDecoder.classTest.php"
/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off /usr/local/Cellar/phpunit-skeleton-generator/1.2.1/libexec/phpunit-skelgen-1.2.1.phar $*
Done.
Most of the tutorials and help I find on the internet are for Netbeans 7.x, which makes things difficult. I tried with various bootstrap files and xml files but no other result. The exit doesn't tell me anything and nothing happens. I searched this a bit but didn't find anything similar to my problem.
The only thing I notice is the part --ansi
that the skeleton generator documentation doesn't seem to offer.
My question is, how can I get Netbeans to generate tests using phpunit's skeleton generator?
source to share
- I installed phpunit on my Mac manually according to the instruction manual (it's pretty straightforward so you don't need a brew script).
- Then in Netbeans settings (8.0.2) (PHP-> Frameworks & Tools-> PHPUnit) I set paths to sctipts.
- Phpunit must be enabled in the project properties (I know this is obvious). And then Tools-> Create tests only works out of the box. :)
However, my first experience with phpunit setup wasn't all that fun. Therefore, I can understand that users might be frustrated at the beginning. This was because I was expecting full automation through plugin installation and things like that that didn't work. That is why I am describing the complete process (phpunit + netbeans on osx) on my [blog] [1].
source to share