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
Fix JUnit missing PHPT results #3437
Fix JUnit missing PHPT results #3437
Conversation
Codecov Report
@@ Coverage Diff @@
## 7.5 #3437 +/- ##
============================================
+ Coverage 83.31% 83.41% +0.09%
- Complexity 3612 3614 +2
============================================
Files 143 143
Lines 9619 9627 +8
============================================
+ Hits 8014 8030 +16
+ Misses 1605 1597 -8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## 7.5 #3437 +/- ##
============================================
- Coverage 83.31% 83.26% -0.05%
- Complexity 3612 3614 +2
============================================
Files 143 143
Lines 9619 9627 +8
============================================
+ Hits 8014 8016 +2
- Misses 1605 1611 +6
Continue to review full report at Codecov.
|
f0dc8c2
to
dd5f065
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for late response.
Comment below.
@@ -318,10 +313,6 @@ public function startTest(Test $test): void | |||
*/ | |||
public function endTest(Test $test, float $time): void | |||
{ | |||
if (!$test instanceof TestCase) { | |||
return; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change fixes phpttestcase, but it will cause fatal errors for third party implementations of Test interface having no getNumAssertions
or hasOutput
methods.
It would be the best to check if those methods exist before calling them.
Up until 7.3.5 here was a condition to check if hasOutput
method exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, now I understand the history here a bit better. Other implementations can run into the exact same problem of course.
I will add some safety around this.
Fixes #3436
Fixed JUnit logger by implementing more methods from
TestCase
inPhptTestCase
.Changes:
instanceof TestCase
PhptTestCase
always returns number of run assertions of 1PhptTestCase
now correctly replies it doesn't use a dataproviderPhptTestCase
now returns theSTDOUT
of a test for<system-out>
elementThanks to @Naktibalda for noticing the bug.