[ 
https://issues.apache.org/jira/browse/NETBEANS-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16845047#comment-16845047
 ] 

Manuel Hirsch commented on NETBEANS-2573:
-----------------------------------------

Hi. I ran into the same problem.

The problem seems to exist since 2015 according to stack overflow and seems to 
have been fixed at some time in a nightly build. (See here: 
[https://stackoverflow.com/questions/31904519/how-to-fix-the-unrecognized-option-run-on-netbeans-running-phpunit/56242747]
 )

I fixed it with a wrapper script:

The NetBeansSuite.php script is not needed at all, IMHO. But I'm new to 
NetBeans so maybe I haven't found out yet what it is good for. It does the same 
the phpunit script does.

I define my test suites in phpunit.xml and also a default suite. The wrapper 
removes NetBeansSuite.php completely and passes just the part after "\-\-run=" 
to the phpunit script. This may break though when several arguments are passed 
(I see the NetBeansSuite supports that separated by semicolons, those would 
need to be converted to spaces and quotations marks, I think.) But I haven't 
ran into this issue yet.

BR&HTH

> PHPUNIT update breaks running single test
> -----------------------------------------
>
>                 Key: NETBEANS-2573
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-2573
>             Project: NetBeans
>          Issue Type: Bug
>          Components: php - PHPUnit
>    Affects Versions: 11.0
>         Environment: Netbeans 11.0, PHP 7.3
>            Reporter: Alan Langford
>            Assignee: Tomáš Myšík
>            Priority: Major
>
> When running a single test file and PHPUnit installed via composer, Netbeans 
> generates a command line of this general form:
> php.exe "\{project}\vendor\phpunit\phpunit\phpunit" "--colors" "log-junit" 
> "\{temp}\nb-phpunit-log.xml" "configuration" "\{project}\phpunit.xml" 
> "coverage-clover" "\{temp}\nb-phpunit-coverage.xml" "C:\Program 
> Files\netbeans 11\php\phpunit\NetBeansSuite.php" "--" 
> "–run=\{project}\tests\SomeTest.php"
> The "–" argument used to fool PHPUnit. PHPUnit would strip the dashes and 
> pass a empty string for the name of the test file.
> NetBeansSuite.php would then extract the --run=argument and run the test.
> The latest master for PHPUnit (a79e18fe27) has changed the way command lines 
> are parsed; the "–" is discarded. PHPUnit then reports an error:
> Cannot open file "–run=\{project}\tests\SomeTest.php"
> I believe passing
> NetBeansSuite "C:\Program Files\netbeans 11\php\phpunit\NetBeansSuite.php"
> instead of
> "C:\Program Files\netbeans 11\php\phpunit\NetBeansSuite.php" "–"
> Will resolve the problem.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to