[PhpUnitBridge] Added support for PHPUnit 7 in Coverage Listener#26089
[PhpUnitBridge] Added support for PHPUnit 7 in Coverage Listener#26089nicolas-grekas merged 1 commit intosymfony:3.4from
Conversation
| Q | A |
|---|---|
| Branch? | 3.4 |
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | |
| License | MIT |
| Doc PR |
| if (\PHP_VERSION_ID >= 70000) { | ||
| exec('type phpdbg', $output, $returnCode); | ||
|
|
||
| if (\PHP_VERSION_ID >= 70000 && 0 === $returnCode) { |
There was a problem hiding this comment.
ping @nicolas-grekas : I did not have phpdbg on my machine, so I added that (IIRC, you added this part)
There was a problem hiding this comment.
would it work on windows?
There was a problem hiding this comment.
We don't care as this test is not run on windows ;)
| if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) { | ||
| class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListener', 'Symfony\Bridge\PhpUnit\CoverageListener'); | ||
| } elseif (version_compare(\PHPUnit\Runner\Version::id(), '7.0.0', '>=')) { | ||
| require_once __DIR__.'/CoverageListenerWithReturnTypes.php'; |
There was a problem hiding this comment.
I don't get why I have to do that :/
Without this line, I got
PHP Warning: Class 'Symfony\Bridge\PhpUnit\CoverageListenerWithReturnTypes' not found in /home/gregoire/dev/github.com/lyrixx/symfony/src/Symfony/Bridge/PhpUnit/CoverageListener.php on line 25
How to reproduce:
- install phpunit 7+
- get my branch
cd src/Symfony/Bridge/PhpUnit/composer installphpunit
There was a problem hiding this comment.
Strange. Related: in #26139 I'm proposing to completely split implems in separate classes, and do only aliases here. I'd suggest to do the same here.
There was a problem hiding this comment.
okay, I will mimic your PR
bd117f7 to
8a824e6
Compare
|
I updated the PR to mimic existing code. |
8a824e6 to
6c0e6af
Compare
Ok, now the listener does not need anymore the The PR is now ready |
|
Thank you @lyrixx. |
…stener (lyrixx) This PR was merged into the 3.4 branch. Discussion ---------- [PhpUnitBridge] Added support for PHPUnit 7 in Coverage Listener | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 6c0e6af [PhpUnitBridge] Added support for PHPUnit 7 in Coverage Listener
|
|
||
| public function startTestSuite(TestSuite $suite): void | ||
| { | ||
| $this->trait->startTest($test); |
There was a problem hiding this comment.
This is wrong, the suite variable should be used