Skip to content

Commit

Permalink
bug #24499 [Bridge\PhpUnit] Fix infinite loop when running isolated m…
Browse files Browse the repository at this point in the history
…ethod (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)
  • Loading branch information
nicolas-grekas committed Oct 9, 2017
1 parent 4ed67a6 commit 9b6b3c0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Symfony/Bridge/PhpUnit/bin/simple-phpunit
Expand Up @@ -81,11 +81,18 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
define('PHPUNIT_COMPOSER_INSTALL', __DIR__.'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
if (!class_exists('SymfonyBlacklistPhpunit', false)) {
class SymfonyBlacklistPhpunit {}
}
if (class_exists('PHPUnit_Util_Blacklist')) {
PHPUnit_Util_Blacklist::$blacklistedClassNames['\PHPUnit\Framework\TestCase'] = 3;
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
PHPUnit_Util_Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
} else {
PHPUnit\Util\Blacklist::$blacklistedClassNames['\PHPUnit\Framework\TestCase'] = 3;
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistPhpunit'] = 1;
PHPUnit\Util\Blacklist::$blacklistedClassNames['SymfonyBlacklistSimplePhpunit'] = 1;
}
Symfony\Bridge\PhpUnit\TextUI\Command::main();
EOPHP
Expand Down Expand Up @@ -204,6 +211,9 @@ if ($components) {
}
}
} elseif (!isset($argv[1]) || 'install' !== $argv[1] || file_exists('install')) {
if (!class_exists('SymfonyBlacklistSimplePhpunit', false)) {
class SymfonyBlacklistSimplePhpunit {}
}
array_splice($argv, 1, 0, array('--colors=always'));
$_SERVER['argv'] = $argv;
$_SERVER['argc'] = ++$argc;
Expand Down

0 comments on commit 9b6b3c0

Please sign in to comment.