Skip to content

Commit 9b6b3c0

Browse files
bug symfony#24499 [Bridge\PhpUnit] Fix infinite loop when running isolated method (bis) (nicolas-grekas)
This PR was merged into the 4.0-dev branch. Discussion ---------- [Bridge\PhpUnit] Fix infinite loop when running isolated method (bis) | 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 | - The blacklisting system is a bit rigid, so let's work around it. Commits ------- 9d9d596 [Bridge\PhpUnit] Fix infinite loop when running isolated method (bis)
1 parent 4ed67a6 commit 9b6b3c0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,18 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
8181
8282
define('PHPUNIT_COMPOSER_INSTALL', __DIR__.'/vendor/autoload.php');
8383
require PHPUNIT_COMPOSER_INSTALL;
84+
85+
if (!class_exists('SymfonyBlacklistPhpunit', false)) {
86+
class SymfonyBlacklistPhpunit {}
87+
}
8488
if (class_exists('PHPUnit_Util_Blacklist')) {
85-
PHPUnit_Util_Blacklist::$blacklistedClassNames['\PHPUnit\Framework\TestCase'] = 3;
89+
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
90+
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
8691
} else {
87-
PHPUnit\Util\Blacklist::$blacklistedClassNames['\PHPUnit\Framework\TestCase'] = 3;
92+
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
93+
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
8894
}
95+
8996
Symfony\Bridge\PhpUnit\TextUI\Command::main();
9097

9198
EOPHP
@@ -204,6 +211,9 @@ if ($components) {
204211
}
205212
}
206213
} elseif (!isset($argv[1]) || 'install' !== $argv[1] || file_exists('install')) {
214+
if (!class_exists('SymfonyBlacklistSimplePhpunit', false)) {
215+
class SymfonyBlacklistSimplePhpunit {}
216+
}
207217
array_splice($argv, 1, 0, array('--colors=always'));
208218
$_SERVER['argv'] = $argv;
209219
$_SERVER['argc'] = ++$argc;

0 commit comments

Comments
 (0)