Merge branch '4.0'
* 4.0: [Bridge/PhpUnit] hotfix
This commit is contained in:
commit
e4d683235b
@ -29,7 +29,7 @@ class SymfonyTestsListenerForV6 extends BaseTestListener
|
||||
|
||||
public function __construct(array $mockedNamespaces = array())
|
||||
{
|
||||
$this->trait = new Legacy\SymfonyTestsListenerTrait($mockedNamespaces);
|
||||
$this->trait = new SymfonyTestsListenerTrait($mockedNamespaces);
|
||||
}
|
||||
|
||||
public function globalListenerDisabled()
|
||||
|
@ -23,7 +23,7 @@ class TestRunner extends \PHPUnit_TextUI_TestRunner
|
||||
*/
|
||||
protected function handleConfiguration(array &$arguments)
|
||||
{
|
||||
$listener = new SymfonyTestsListener();
|
||||
$listener = new SymfonyTestsListenerForV5();
|
||||
|
||||
$result = parent::handleConfiguration($arguments);
|
||||
|
||||
@ -32,7 +32,7 @@ class TestRunner extends \PHPUnit_TextUI_TestRunner
|
||||
$registeredLocally = false;
|
||||
|
||||
foreach ($arguments['listeners'] as $registeredListener) {
|
||||
if ($registeredListener instanceof SymfonyTestsListener) {
|
||||
if ($registeredListener instanceof SymfonyTestsListenerForV5) {
|
||||
$registeredListener->globalListenerDisabled();
|
||||
$registeredLocally = true;
|
||||
break;
|
||||
|
@ -15,22 +15,20 @@ use PHPUnit\TextUI\Command as BaseCommand;
|
||||
|
||||
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
|
||||
class_alias('Symfony\Bridge\PhpUnit\Legacy\Command', 'Symfony\Bridge\PhpUnit\TextUI\Command');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Command extends BaseCommand
|
||||
{
|
||||
} else {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
protected function createRunner()
|
||||
class Command extends BaseCommand
|
||||
{
|
||||
return new TestRunner($this->arguments['loader']);
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function createRunner()
|
||||
{
|
||||
return new TestRunner($this->arguments['loader']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,42 +16,40 @@ use Symfony\Bridge\PhpUnit\SymfonyTestsListener;
|
||||
|
||||
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
|
||||
class_alias('Symfony\Bridge\PhpUnit\Legacy\TestRunner', 'Symfony\Bridge\PhpUnit\TextUI\TestRunner');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class TestRunner extends BaseRunner
|
||||
{
|
||||
} else {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
protected function handleConfiguration(array &$arguments)
|
||||
class TestRunner extends BaseRunner
|
||||
{
|
||||
$listener = new SymfonyTestsListener();
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function handleConfiguration(array &$arguments)
|
||||
{
|
||||
$listener = new SymfonyTestsListener();
|
||||
|
||||
$result = parent::handleConfiguration($arguments);
|
||||
$result = parent::handleConfiguration($arguments);
|
||||
|
||||
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
|
||||
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
|
||||
|
||||
$registeredLocally = false;
|
||||
$registeredLocally = false;
|
||||
|
||||
foreach ($arguments['listeners'] as $registeredListener) {
|
||||
if ($registeredListener instanceof SymfonyTestsListener) {
|
||||
$registeredListener->globalListenerDisabled();
|
||||
$registeredLocally = true;
|
||||
break;
|
||||
foreach ($arguments['listeners'] as $registeredListener) {
|
||||
if ($registeredListener instanceof SymfonyTestsListener) {
|
||||
$registeredListener->globalListenerDisabled();
|
||||
$registeredLocally = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$registeredLocally) {
|
||||
$arguments['listeners'][] = $listener;
|
||||
}
|
||||
if (!$registeredLocally) {
|
||||
$arguments['listeners'][] = $listener;
|
||||
}
|
||||
|
||||
return $result;
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user