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

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

This is a new breakage caused by changes to the command line parser in PHPUnit. 
I would not be surprised if the PHPUnit team is unreceptive to our request for 
argument pass-through, especially since the lead developer's response to my 
comment about this on Twitter was to suggest PHPStorm :(.

[~mhirsch] is correct. NetBeansSuite.php is no longer required as PHPUnit has 
the capacity to achieve the same goals without it.

A CLI solution to running multiple tests may be in the works 
([https://github.com/sebastianbergmann/phpunit/issues/3387]) but I suspect 
generating a temporary XML file would be both more robust and more maintainable 
long term. Theoretically we take the base phpunit.xml and apply a transform to 
it to get what we want. If that transform is saved in configuration/settings, 
then if the base file changes it's a matter of reworking the transform and no 
code needs to change. This would also make it easier to track breaking changes 
between versions of PHPUnit.

> 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: 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