Skip to content
This repository was archived by the owner on Jul 26, 2021. It is now read-only.
This repository was archived by the owner on Jul 26, 2021. It is now read-only.

Possible regression in 2.0.0 #67

@sebastianbergmann

Description

@sebastianbergmann

With https://github.com/sebastianbergmann/php-code-coverage @ c3a4de854cbd91af0993d4be36c3a4db8ef24f6b:

$ ant setup 
Buildfile: /usr/local/src/php-code-coverage/build.xml

clean:
   [delete] Deleting directory /usr/local/src/php-code-coverage/vendor
   [delete] Deleting: /usr/local/src/php-code-coverage/composer.lock

composer:
 [composer] Loading composer repositories with package information
 [composer] Updating dependencies (including require-dev)
 [composer] Package operations: 27 installs, 0 updates, 0 removals
 [composer]   - Installing phpunit/php-token-stream (2.0.0): Loading from cache
 [composer]   - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
 [composer]   - Installing theseer/tokenizer (1.1.0): Loading from cache
 [composer]   - Installing sebastian/version (2.0.1): Loading from cache
 [composer]   - Installing sebastian/resource-operations (1.0.0): Loading from cache
 [composer]   - Installing sebastian/recursion-context (3.0.0): Loading from cache
 [composer]   - Installing sebastian/object-reflector (1.1.1): Loading from cache
 [composer]   - Installing sebastian/object-enumerator (3.0.3): Loading from cache
 [composer]   - Installing sebastian/global-state (2.0.0): Loading from cache
 [composer]   - Installing sebastian/exporter (3.1.0): Loading from cache
 [composer]   - Installing sebastian/environment (3.1.0): Loading from cache
 [composer]   - Installing sebastian/diff (1.4.3): Loading from cache
 [composer]   - Installing sebastian/comparator (2.0.0): Loading from cache
 [composer]   - Installing doctrine/instantiator (1.1.0): Loading from cache
 [composer]   - Installing phpunit/php-text-template (1.2.1): Loading from cache
 [composer]   - Installing phpunit/phpunit-mock-objects (4.0.3): Loading from cache
 [composer]   - Installing phpunit/php-timer (1.0.9): Loading from cache
 [composer]   - Installing phpunit/php-file-iterator (1.4.2): Loading from cache
 [composer]   - Installing webmozart/assert (1.2.0): Loading from cache
 [composer]   - Installing phpdocumentor/reflection-common (1.0): Loading from cache
 [composer]   - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
 [composer]   - Installing phpdocumentor/reflection-docblock (3.2.0): Loading from cache
 [composer]   - Installing phpspec/prophecy (v1.7.0): Loading from cache
 [composer]   - Installing phar-io/version (1.0.1): Loading from cache
 [composer]   - Installing phar-io/manifest (1.0.1): Loading from cache
 [composer]   - Installing myclabs/deep-copy (1.6.1): Loading from cache
 [composer]   - Installing phpunit/phpunit (6.2.4): Loading from cache
 [composer] Writing lock file
 [composer] Generating optimized autoload files

setup:

BUILD SUCCESSFUL
Total time: 3 seconds
$ ./vendor/bin/phpunit     
PHPUnit 6.2.4 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.1.7 with Xdebug 2.5.5
Configuration: /usr/local/src/php-code-coverage/phpunit.xml

........F..SS..........................F..................F..F... 65 / 66 ( 98%)
F                                                                 66 / 66 (100%)

Time: 220 ms, Memory: 10.00MB

There were 5 failures:

1) SebastianBergmann\CodeCoverage\Report\CloverTest::testCloverForClassWithAnonymousFunction
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
       <line num="13" type="stmt" count="1"/>
-      <metrics loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="10" coveredelements="8"/>
+      <metrics loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="4" elements="7" coveredelements="5"/>
     </file>
-    <metrics files="1" loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="8" coveredstatements="7" elements="10" coveredelements="8"/>
+    <metrics files="1" loc="19" ncloc="17" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="5" coveredstatements="4" elements="7" coveredelements="5"/>
   </project>
 </coverage>

/usr/local/src/php-code-coverage/tests/tests/CloverTest.php:46

2) SebastianBergmann\CodeCoverage\CodeCoverageTest::testGetLinesToBeIgnored3
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
     6 => 11
-    7 => 15
-    8 => 16
-    9 => 19
-    10 => 20
+    7 => 14
+    8 => 15
+    9 => 16
+    10 => 17
+    11 => 18
+    12 => 19
+    13 => 20
 )

/usr/local/src/php-code-coverage/tests/tests/CodeCoverageTest.php:407

3) SebastianBergmann\CodeCoverage\Report\Html\HTMLTest::testForClassWithAnonymousFunction
index.html not match
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
       <td class="warning big">       <div class="progress">
-         <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
-           <span class="sr-only">87.50% covered (warning)</span>
+         <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="80.00" aria-valuemin="0" aria-valuemax="100" style="width: 80.00%">
+           <span class="sr-only">80.00% covered (warning)</span>
          </div>
        </div>
 </td>
-      <td class="warning small"><div align="right">87.50%</div></td>
-      <td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
+      <td class="warning small"><div align="right">80.00%</div></td>
+      <td class="warning small"><div align="right">4&nbsp;/&nbsp;5</div></td>
@@ @@
       <td class="warning big">       <div class="progress">
-         <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="87.50" aria-valuemin="0" aria-valuemax="100" style="width: 87.50%">
-           <span class="sr-only">87.50% covered (warning)</span>
+         <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="80.00" aria-valuemin="0" aria-valuemax="100" style="width: 80.00%">
+           <span class="sr-only">80.00% covered (warning)</span>
          </div>
        </div>
 </td>
-      <td class="warning small"><div align="right">87.50%</div></td>
-      <td class="warning small"><div align="right">7&nbsp;/&nbsp;8</div></td>
+      <td class="warning small"><div align="right">80.00%</div></td>
+      <td class="warning small"><div align="right">4&nbsp;/&nbsp;5</div></td>
       <td class="danger big">       <div class="progress">
          <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="50.00" aria-valuemin="0" aria-valuemax="100" style="width: 50.00%">
            <span class="sr-only">50.00% covered (danger)</span>
          </div>
        </div>
 </td>
       <td class="danger small"><div align="right">50.00%</div></td>
       <td class="danger small"><div align="right">1&nbsp;/&nbsp;2</div></td>
       <td class="danger big">       <div class="progress">
          <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="0.00" aria-valuemin="0" aria-valuemax="100" style="width: 0.00%">
            <span class="sr-only">0.00% covered (danger)</span>
          </div>
        </div>
 </td>
       <td class="danger small"><div align="right">0.00%</div></td>
       <td class="danger small"><div align="right">0&nbsp;/&nbsp;1</div></td>
      </tr>
 
 
     </tbody>
    </table>
    <footer>
     <hr/>
     <h4>Legend</h4>
     <p>
      <span class="danger"><strong>Low</strong>: 0% to 50%</span>
      <span class="warning"><strong>Medium</strong>: 50% to 90%</span>
      <span class="success"><strong>High</strong>: 90% to 100%</span>
     </p>
     <p>
      <small>Generated by <a href="https://github.com/sebastianbergmann/php-code-coverage" target="_top">php-code-coverage 5.2.2-2-gc3a4de8</a> using <a href="https://secure.php.net/" target="_top">PHP 7.1.7</a> with <a href="https://xdebug.org/">Xdebug 2.5.5</a> at Thu Aug 3 14:43:19 UTC 2017.</small>
     </p>
    </footer>
   </div>
   <script src=".js/jquery.min.js" type="text/javascript"></script>
   <script src=".js/bootstrap.min.js" type="text/javascript"></script>
   <script src=".js/holder.min.js" type="text/javascript"></script>
  </body>
 </html>

/usr/local/src/php-code-coverage/tests/tests/HTMLTest.php:99
/usr/local/src/php-code-coverage/tests/tests/HTMLTest.php:70

4) SebastianBergmann\CodeCoverage\Report\TextTest::testTextForClassWithAnonymousFunction
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
   Methods: 50.00% (1/2)
-  Lines:   87.50% (7/8)
+  Lines:   80.00% (4/5)
 
 CoveredClassWithAnonymousFunctionInStaticMethod
   Methods:  50.00% ( 1/ 2)   Lines:  80.00% (  4/  5)

/usr/local/src/php-code-coverage/tests/tests/TextTest.php:46

5) SebastianBergmann\CodeCoverage\Report\Xml\XMLTest::testForClassWithAnonymousFunction
index.xml not match
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
       <totals>
-        <lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50"/>
+        <lines total="19" comments="2" code="17" executable="5" executed="4" percent="80.00"/>
@@ @@
         <totals>
-          <lines total="19" comments="2" code="17" executable="8" executed="7" percent="87.50"/>
+          <lines total="19" comments="2" code="17" executable="5" executed="4" percent="80.00"/>
           <methods count="2" tested="1" percent="50.00"/>
           <functions count="0" tested="0" percent="0"/>
           <classes count="1" tested="0" percent="0.00"/>
           <traits count="0" tested="0" percent="0"/>
         </totals>
       </file>
     </directory>
   </project>
 </phpunit>

/usr/local/src/php-code-coverage/tests/tests/XMLTest.php:95
/usr/local/src/php-code-coverage/tests/tests/XMLTest.php:66

--

There were 2 skipped tests:

1) SebastianBergmann\CodeCoverage\CodeCoverageTest::testCanBeConstructedForPhpdbgWithoutGivenFilterObject
Requires PHPDBG

/usr/local/src/php-code-coverage/tests/tests/CodeCoverageTest.php:71

2) SebastianBergmann\CodeCoverage\CodeCoverageTest::testCanBeConstructedForPhpdbgWithGivenFilterObject
Requires PHPDBG

/usr/local/src/php-code-coverage/tests/tests/CodeCoverageTest.php:90

FAILURES!
Tests: 66, Assertions: 147, Failures: 5, Skipped: 2.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions