forked from sebastianbergmann/php-code-coverage
-
Notifications
You must be signed in to change notification settings - Fork 0
2 add branch coverage in text reporter #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jmrieger
merged 8 commits into
25-directory-node-path-support
from
2-add-branch-coverage-in-text-reporter
Jun 12, 2019
Merged
2 add branch coverage in text reporter #28
jmrieger
merged 8 commits into
25-directory-node-path-support
from
2-add-branch-coverage-in-text-reporter
Jun 12, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Owner
Author
|
Example output: /usr/local/Cellar/[email protected]/7.1.29/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /Users/jrieger/Projects/sebastianbergmann/phpunit/phpunit --coverage-text --branch-coverage tests/unit/Util/JsonTest.php
PHPUnit 7.5.7-4-g1f2ed4b39 by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.29 with Xdebug 2.7.2
Configuration: /Users/jrieger/Projects/sebastianbergmann/phpunit/phpunit.xml
....... 7 / 7 (100%)
Time: 7.45 seconds, Memory: 48.00 MB
OK (7 tests, 11 assertions)
Code Coverage Report:
2019-06-10 19:16:06
Summary:
Classes: 100.00% (10/10)
Methods: 100.00% (52/52)
Lines: 100.00% (299/299)
Branches: 100.00% (195/195)
Paths: 0.41% (52/12604)
\PHPUnit\Framework::PHPUnit\Framework\Assert
Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 12/ 12) Branches: 100.00% ( 3/ 3) Paths: 100.00% ( 3/ 3)
\PHPUnit\Framework::PHPUnit\Framework\Exception
Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 5/ 5) Branches: 100.00% ( 4/ 4) Paths: 33.33% ( 1/ 3)
\PHPUnit\Framework::PHPUnit\Framework\TestCase
Methods: 100.00% (25/25) Lines: 100.00% (142/142) Branches: 100.00% (107/107) Paths: 0.55% ( 25/4571)
\PHPUnit\Framework::PHPUnit\Framework\TestResult
Methods: 100.00% ( 1/ 1) Lines: 100.00% ( 31/ 31) Branches: ( 0/ 0) Paths: ( 0/ 0)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\Constraint
Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 9/ 9) Branches: 100.00% ( 7/ 7) Paths: 37.50% ( 3/ 8)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\Exception
Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 4/ 4) Branches: 100.00% ( 2/ 2) Paths: 100.00% ( 2/ 2)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\ExceptionMessage
Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 5/ 5) Branches: 100.00% ( 3/ 3) Paths: 66.67% ( 2/ 3)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\IsEqual
Methods: 100.00% ( 2/ 2) Lines: 100.00% ( 9/ 9) Branches: 100.00% ( 3/ 3) Paths: 40.00% ( 2/ 5)
\PHPUnit\Util::PHPUnit\Util\Json
Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 19/ 19) Branches: 100.00% ( 16/ 16) Paths: 33.33% ( 5/ 15)
\PHPUnit\Util::PHPUnit\Util\Test
Methods: 100.00% (10/10) Lines: 100.00% ( 63/ 63) Branches: 100.00% ( 50/ 50) Paths: 0.11% ( 9/7994)
Process finished with exit code 0
|
Owner
Author
|
Hmmm, there's a lot of false positive here. The following is run on phpunit tag 7.5 and php-code-coverage tag 6.0 |
Fix additional covered lines functionality
Owner
Author
|
Fixed the issues above. New output below. Note that there are additional lines reported in the summary - this is to be expected, since I added new lines to phpunit/phpunit to support the branch coverage flag. /usr/local/Cellar/[email protected]/7.1.29/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 /Users/jrieger/Projects/sebastianbergmann/phpunit/phpunit --coverage-text tests/unit/Util/JsonTest.php
PHPUnit 7.5.7-6-g0868d442d by Sebastian Bergmann and contributors.
Runtime: PHP 7.1.29 with Xdebug 2.7.2
Configuration: /Users/jrieger/Projects/sebastianbergmann/phpunit/phpunit.xml
....... 7 / 7 (100%)
Time: 4.16 seconds, Memory: 18.00 MB
OK (7 tests, 11 assertions)
Code Coverage Report:
2019-06-12 12:38:08
Summary:
Classes: 0.70% (1/143)
Methods: 1.99% (24/1206)
Lines: 3.31% (299/9034)
\PHPUnit\Framework::PHPUnit\Framework\Assert
Methods: 1.58% ( 3/190) Lines: 1.28% ( 12/935)
\PHPUnit\Framework::PHPUnit\Framework\Exception
Methods: 25.00% ( 1/ 4) Lines: 45.45% ( 5/ 11)
\PHPUnit\Framework::PHPUnit\Framework\TestCase
Methods: 7.94% ( 10/126) Lines: 18.93% (142/750)
\PHPUnit\Framework::PHPUnit\Framework\TestResult
Methods: 0.00% ( 0/ 63) Lines: 8.29% ( 31/374)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\Constraint
Methods: 28.57% ( 2/ 7) Lines: 36.00% ( 9/ 25)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\Exception
Methods: 50.00% ( 2/ 4) Lines: 20.00% ( 4/ 20)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\ExceptionMessage
Methods: 25.00% ( 1/ 4) Lines: 29.41% ( 5/ 17)
\PHPUnit\Framework\Constraint::PHPUnit\Framework\Constraint\IsEqual
Methods: 33.33% ( 1/ 3) Lines: 21.95% ( 9/ 41)
\PHPUnit\Util::PHPUnit\Util\Json
Methods: 100.00% ( 3/ 3) Lines: 100.00% ( 19/ 19)
\PHPUnit\Util::PHPUnit\Util\Test
Methods: 3.23% ( 1/ 31) Lines: 13.18% ( 63/478)
Process finished with exit code 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on #27 (25-directory-node-path-support)
Addresses #2
Changes
Utilto pad spacing if no percentage is to be reported,$asStringistrue, and$fixedWidthistrue