File tree Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Expand file tree Collapse file tree 3 files changed +53
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class TestRunnerForV6 extends BaseRunner
24
24
/**
25
25
* {@inheritdoc}
26
26
*/
27
- protected function handleConfiguration (array &$ arguments ): void
27
+ protected function handleConfiguration (array &$ arguments )
28
28
{
29
29
$ listener = new SymfonyTestsListener ();
30
30
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Symfony \Bridge \PhpUnit \Legacy ;
13
+
14
+ use PHPUnit \TextUI \TestRunner as BaseRunner ;
15
+ use Symfony \Bridge \PhpUnit \SymfonyTestsListener ;
16
+
17
+ /**
18
+ * {@inheritdoc}
19
+ *
20
+ * @internal
21
+ */
22
+ class TestRunnerForV7 extends BaseRunner
23
+ {
24
+ /**
25
+ * {@inheritdoc}
26
+ */
27
+ protected function handleConfiguration (array &$ arguments ): void
28
+ {
29
+ $ listener = new SymfonyTestsListener ();
30
+
31
+ parent ::handleConfiguration ($ arguments );
32
+
33
+ $ arguments ['listeners ' ] = isset ($ arguments ['listeners ' ]) ? $ arguments ['listeners ' ] : array ();
34
+
35
+ $ registeredLocally = false ;
36
+
37
+ foreach ($ arguments ['listeners ' ] as $ registeredListener ) {
38
+ if ($ registeredListener instanceof SymfonyTestsListener) {
39
+ $ registeredListener ->globalListenerDisabled ();
40
+ $ registeredLocally = true ;
41
+ break ;
42
+ }
43
+ }
44
+
45
+ if (!$ registeredLocally ) {
46
+ $ arguments ['listeners ' ][] = $ listener ;
47
+ }
48
+ }
49
+ }
Original file line number Diff line number Diff line change 13
13
14
14
if (class_exists ('PHPUnit_Runner_Version ' ) && version_compare (\PHPUnit_Runner_Version::id (), '6.0.0 ' , '< ' )) {
15
15
class_alias ('Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV5 ' , 'Symfony\Bridge\PhpUnit\TextUI\TestRunner ' );
16
- } else {
16
+ } elseif ( class_exists ( ' PHPUnit_Runner_Version ' ) && version_compare (\PHPUnit_Runner_Version:: id (), ' 7.0.0 ' , ' < ' )) {
17
17
class_alias ('Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV6 ' , 'Symfony\Bridge\PhpUnit\TextUI\TestRunner ' );
18
+ } else {
19
+ class_alias ('Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV7 ' , 'Symfony\Bridge\PhpUnit\TextUI\TestRunner ' );
18
20
}
19
21
20
22
if (false ) {
You can’t perform that action at this time.
0 commit comments