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
Merged
sebastianbergmann
merged 6 commits into
sebastianbergmann:7.5
from
epdenouden:issue-3436-junit-logger-ignores-phpt-tests
Dec 6, 2018
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
07fa792
Implement more TestCase methods so JUnit logger can handle PHPT
epdenouden b973fe7
CS/WS fixes
epdenouden fad9e19
Add test coverage for newly added information methods
epdenouden 895af90
CS/WS fixes
epdenouden dd5f065
Add tests for including PHPT results in TeamCity and JUnit loggers
epdenouden e6ab8c4
Fix Windows paths in tests
epdenouden File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--TEST-- | ||
phpunit --log-junit php://stdout ../end-to-end/phpt-stderr.phpt | ||
--FILE-- | ||
<?php | ||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = '--log-junit'; | ||
$_SERVER['argv'][3] = 'php://stdout'; | ||
$_SERVER['argv'][4] = \realpath(__DIR__ . '/../end-to-end/phpt-stderr.phpt'); | ||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
?> | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
. 1 / 1 (100%)<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuites> | ||
<testsuite name="" tests="1" assertions="1" errors="0" failures="0" skipped="0" time="%s"> | ||
<testcase name="%send-to-end%ephpt-stderr.phpt" assertions="1" time="%s"> | ||
<system-out>PHPUnit must look at STDERR when running PHPT tests.</system-out> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> | ||
|
||
|
||
Time: %s, Memory: %s | ||
|
||
OK (1 test, 1 assertion) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--TEST-- | ||
phpunit --log-teamcity php://stdout ../end-to-end/phpt-stderr.phpt | ||
--FILE-- | ||
<?php | ||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = '--log-teamcity'; | ||
$_SERVER['argv'][3] = 'php://stdout'; | ||
$_SERVER['argv'][4] = \realpath(__DIR__ . '/../end-to-end/phpt-stderr.phpt'); | ||
|
||
require __DIR__ . '/../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
|
||
##teamcity[testCount count='1' flowId='%d'] | ||
|
||
##teamcity[testStarted name='%send-to-end%ephpt-stderr.phpt' flowId='%d'] | ||
. 1 / 1 (100%) | ||
##teamcity[testFinished name='%send-to-end%ephpt-stderr.phpt' duration='%d' flowId='%d'] | ||
|
||
|
||
Time: %s, Memory: %s | ||
|
||
OK (1 test, 1 assertion) |
This file contains 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
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.
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
orhasOutput
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.