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

Alan Langford commented on NETBEANS-2573:
-----------------------------------------

[~tmysik] I understand. Not a huge problem for me since I'll just patch PHPUnit 
to ignore the Netbeans argument until a better solution is available. It's a 
bit of a pain and I suspect other users won't find this a good solution.

[~czukowski] That's what the current approach does, but more restrictive 
command line parsing in PHPUnit 8.2 breaks the approach. I don't think putting 
Netbeans stuff on the command line is viable anymore. Generating a temporary 
phpunit.xml from a template seems like the most robust approach. Until then 
here's the kludge: in the file TextUI/Command.php in the handleArguments array, 
just change the line that reads

if (isset($this->options[1][1])) {

to

if (isset($this->options[1][1])) && substr($this->options[1][1], 0, 6) != 
'--run=') {

This ignores the Netbeans-generated argument and everything works as before.

> 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
>              Labels: easyfix
>
> 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: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

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

Reply via email to