2
votes

I have installed PHPUnit follows to their website instructions. When I'm trying to generate test class I got this message:

"D:\wamp\bin\php\php5.4.12\phpunit-skelgen.bat" "--ansi" "generate-test" "main" "D:\Projects\tdd\main.php" "mainTest" "D:\Projects\tdd\tests\mainTest.php"

The referenced parameter '--ansi' is not registered.

Done.

This is happening in Windows and Linux environment as well.

2

2 Answers

2
votes

It happened the same to me. It seems that we were using the old phpunit-skelgen 1.2.1 version. Apparently, NetBeans 8.0.1 assumes you are using the newest version of phpunit-skelgen, that is 2.0.1.

download the new skelgen phar and update the batch file (windows) and you are good to go .

for visual guide follow these blog. http://kevindaus.blogspot.com/2015/01/fix-netbeans-8-create-test-problem.html

1
votes

You can install it via composer globally which will also currently give you v2.0.1:

composer global require "phpunit/phpunit-skeleton-generator=*"

Then put C:\Users\[username]\AppData\Roaming\Composer\vendor\bin\phpunit-skelgen.bat into Netbeans Tools > Options > PHP (tab) > Frameworks & Tools (tab) > PHPUnit section.