Uploaded image for project: 'SonarPHP'
  1. SonarPHP
  2. SONARPHP-599

NullPointerException in PhpUnitResultParser for report with empty "testsuites"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8
    • Component/s: Unit Tests
    • Labels:
      None

      Description

      When report contains zero testsuites

      <?xml version="1.0" encoding="UTF-8"?> 
      <testsuites/>
      

      PhpUnitResultParser fails with NullPointerException when trying iterate over TestSuites.getTestSuites(), which is null.

      Possible fix will be to initialize field (see https://github.com/SonarSource/sonar-php/blob/master/sonar-php-plugin/src/main/java/org/sonar/plugins/php/phpunit/xml/TestSuites.java#L38) with empty list.

        Attachments

          Activity

            People

            Assignee:
            elena.vilchik Elena Vilchik
            Reporter:
            elena.vilchik Elena Vilchik
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: