Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2573

PHPUNIT update breaks running single test

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 11.0
    • 12.0
    • php - PHPUnit
    • Netbeans 11.0, PHP 7.3

    Description

      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.

      Attachments

        1. image-2019-05-26-18-44-57-451.png
          148 kB
          Vítězslav Dvořák
        2. image-2019-05-26-15-03-10-820.png
          38 kB
          Vítězslav Dvořák

        Issue Links

          Activity

            People

              tmysik Tomas Mysik
              instance1 Alan Langford
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m