8000 bug #23015 [PhpUnitBridge] Fix detection of PHPUnit 5 (enumag) · symfony/symfony@c88a006 · GitHub
[go: up one dir, main page]

Skip to content

Commit c88a006

Browse files
committed
bug #23015 [PhpUnitBridge] Fix detection of PHPUnit 5 (enumag)
This PR was merged into the 3.3 branch. Discussion ---------- [PhpUnitBridge] Fix detection of PHPUnit 5 | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Codeception 2.3 supports both PHPUnit 5 and PHPUnit 6 by defining [aliases](https://github.com/Codeception/Codeception/blob/2.3/shim.php). This confuses symfony/phpunit-bridge and it tries to load BC code for PHPUnit 5 even though I'm using PHPUnit 6. Commits ------- dfb5549 [PhpUnitBridge] Fix detection of PHPUnit 5
2 parents 3594bb4 + dfb5549 commit c88a006

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Bridge/PhpUnit/SymfonyTestsListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use PHPUnit\Framework\TestSuite;
1717
use PHPUnit\Framework\Warning;
1818

19-
if (class_exists('PHPUnit_Framework_BaseTestListener')) {
19+
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
2020
class_alias('Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListener', 'Symfony\Bridge\PhpUnit\SymfonyTestsListener');
2121

2222
return;

src/Symfony/Bridge/PhpUnit/TextUI/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use PHPUnit\TextUI\Command as BaseCommand;
1515

16-
if (class_exists('PHPUnit_TextUI_Command')) {
16+
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
1717
class_alias('Symfony\Bridge\PhpUnit\Legacy\Command', 'Symfony\Bridge\PhpUnit\TextUI\Command');
1818

1919
return;

src/Symfony/Bridge/PhpUnit/TextUI/TestRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\TextUI\TestRun 6A47 ner as BaseRunner;
1515
use Symfony\Bridge\PhpUnit\SymfonyTestsListener;
1616

17-
if (class_exists('PHPUnit_TextUI_Command')) {
17+
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
1818
class_alias('Symfony\Bridge\PhpUnit\Legacy\TestRunner', 'Symfony\Bridge\PhpUnit\TextUI\TestRunner');
1919

2020
return;

0 commit comments

Comments
 (0)
0