Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e4d6832

Browse files
Merge branch '4.0'
* 4.0: [Bridge/PhpUnit] hotfix
2 parents b292d59 + f75730d commit e4d6832

File tree

4 files changed

+38
-42
lines changed

4 files changed

+38
-42
lines changed

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerForV6.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SymfonyTestsListenerForV6 extends BaseTestListener
2929

3030
public function __construct(array $mockedNamespaces = array())
3131
{
32-
$this->trait = new Legacy\SymfonyTestsListenerTrait($mockedNamespaces);
32+
$this->trait = new SymfonyTestsListenerTrait($mockedNamespaces);
3333
}
3434

3535
public function globalListenerDisabled()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestRunner extends \PHPUnit_TextUI_TestRunner
2323
*/
2424
protected function handleConfiguration(array &$arguments)
2525
{
26-
$listener = new SymfonyTestsListener();
26+
$listener = new SymfonyTestsListenerForV5();
2727

2828
$result = parent::handleConfiguration($arguments);
2929

@@ -32,7 +32,7 @@ protected function handleConfiguration(array &$arguments)
3232
$registeredLocally = false;
3333

3434
foreach ($arguments['listeners'] as $registeredListener) {
35-
if ($registeredListener instanceof SymfonyTestsListener) {
35+
if ($registeredListener instanceof SymfonyTestsListenerForV5) {
3636
$registeredListener->globalListenerDisabled();
3737
$registeredLocally = true;
3838
break;

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,20 @@
1515

1616
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');
18-
19-
return;
20-
}
21-
22-
/**
23-
* {@inheritdoc}
24-
*
25-
* @internal
26-
*/
27-
class Command extends BaseCommand
28-
{
18+
} else {
2919
/**
3020
* {@inheritdoc}
21+
*
22+
* @internal
3123
*/
32-
protected function createRunner()
24+
class Command extends BaseCommand
3325
{
34-
return new TestRunner($this->arguments['loader']);
26+
/**
27+
* {@inheritdoc}
28+
*/
29+
protected function createRunner()
30+
{
31+
return new TestRunner($this->arguments['loader']);
32+
}
3533
}
3634
}

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

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,40 @@
1616

1717
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');
19-
20-
return;
21-
}
22-
23-
/**
24-
* {@inheritdoc}
25-
*
26-
* @internal
27-
*/
28-
class TestRunner extends BaseRunner
29-
{
19+
} else {
3020
/**
3121
* {@inheritdoc}
22+
*
23+
* @internal
3224
*/
33-
protected function handleConfiguration(array &$arguments)
25+
class TestRunner extends BaseRunner
3426
{
35-
$listener = new SymfonyTestsListener();
27+
/**
28+
* {@inheritdoc}
29+
*/
30+
protected function handleConfiguration(array &$arguments)
31+
{
32+
$listener = new SymfonyTestsListener();
3633

37-
$result = parent::handleConfiguration($arguments);
34+
$result = parent::handleConfiguration($arguments);
3835

39-
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
36+
$arguments['listeners'] = isset($arguments['listeners']) ? $arguments['listeners'] : array();
4037

41-
$registeredLocally = false;
38+
$registeredLocally = false;
4239

43-
foreach ($arguments['listeners'] as $registeredListener) {
44-
if ($registeredListener instanceof SymfonyTestsListener) {
45-
$registeredListener->globalListenerDisabled();
46-
$registeredLocally = true;
47-
break;
40+
foreach ($arguments['listeners'] as $registeredListener) {
41+
if ($registeredListener instanceof SymfonyTestsListener) {
42+
$registeredListener->globalListenerDisabled();
43+
$registeredLocally = true;
44+
break;
45+
}
4846
}
49-
}
5047

51-
if (!$registeredLocally) {
52-
$arguments['listeners'][] = $listener;
53-
}
48+
if (!$registeredLocally) {
49+
$arguments['listeners'][] = $listener;
50+
}
5451

55-
return $result;
52+
return $result;
53+
}
5654
}
5755
}

0 commit comments

Comments
 (0)