The 6.9 version from the main website cannot run any phpunit tests due to a space in the application's name an no quoting done of the command line arguments passed to phpunit.
Here is a line from running a single test.
/usr/bin/phpunit --log-junit /var/folders/wG/wGrdprT6HmmuglFInzcWZk+++TI/-Tmp-/nb-phpunit-log.xml --bootstrap /Users/Josh/NetBeansProjects/Breach/MainRepo/tests/testinit.php NetBeansSuite /Applications/NetBeans/NetBeans 6.9.app/Contents/Resources/NetBeans/php/phpunit/NetBeansSuite.php run=/Users/Josh/NetBeansProjects/Breach/MainRepo/tests/application/classes/service/json/IncidentsTest.php
The offending argument is below.
It is because of the space in the app name, Netbeans 6.9.app. Previous versions were just called Netbeans.app
Quoting that argument makes the command work
Here is the actual output of the command:
Josh:~$ /usr/bin/phpunit --log-junit /var/folders/wG/wGrdprT6HmmuglFInzcWZk+++TI/-Tmp-/nb-phpunit-log.xml --bootstrap /Users/Josh/NetBeansProjects/Breach/MainRepo/tests/testinit.php NetBeansSuite /Applications/NetBeans/NetBeans 6.9.app/Contents/Resources/NetBeans/php/phpunit/NetBeansSuite.php run=/Users/Josh/NetBeansProjects/Breach/MainRepo/tests/application/classes/service/json/IncidentsTest.php
PHPUnit 3.4.14 by Sebastian Bergmann.
Cannot open file ".//Applications/NetBeans/NetBeans".
Do I understand correctly that if a project has a space in its name, PHPUnit support does not work? If not, please, provide exact steps to reproduce.
If any of the path arguments have a space in them it will fail. In my example, the problem is that the default installed app on OS X is:
The space between Netbeans and 6.9.app is causing the shell to treat them as two arguments.
I guess NetBeans makes its own custom PHPUnit suite and stores it in:
When NetBeans passes this argument to phpunit (and all arguments for that matter) it should be quoted so it is treated as a single argument instead of two
Just now I renamed the app and moved it to:
/Application/Netbeans/6.9/Netbeans.app and phpunit via the Test menu option works as expected.
I will try to reproduce and fix.
Right, it seems that the arguments are not quoted automatically. Needs to be fixed.
(In reply to comment #8)
> Right, it seems that the arguments are not quoted automatically. Needs to be
Petr, can you confirm, please? Or am I wrong?
After discussion with Petr, reassigning.
Fixed in web-main 5f5ad3b12ec3.
Command itself should be escaped as well: 342f06db94e1
Executable escaped on windows only 2658c5b6dcf4.
Minor fix is needed in PHP project as well.
NetBeans test suite fixed (possible quotes taken into account).
Integrated into 'main-golden'
Log: #188240 PHPUnit shell command invalid syntax
Reopening since this seems to be a problem specific only for Mac platform (I cannot reproduce on Linux).
Can you please try to reproduce your problem and tell us what are the arguments passed to the _phpunit script itself_? Just open your phpunit script and use "print_r()" function to print command line arguments ($_SERVER['argv']).
Please, reopen this issue and paste the result here.
Thanks for your coopeartion.
The behavior of EPB reverted to original one 0a0953f22763.
Integrated into 'main-golden'
User: Tomas Mysik <email@example.com>
Log: #188240 - PHPUnit shell command invalid syntax
Quotes taken into account.