File tree 6 files changed +95
-55
lines changed
src/Symfony/Bridge/PhpUnit
6 files changed +95
-55
lines changed Original file line number Diff line number Diff line change 16
16
*
17
17
* @internal
18
18
*/
19
- class Command extends \PHPUnit_TextUI_Command
19
+ class CommandForV5 extends \PHPUnit_TextUI_Command
20
20
{
21
21
/**
22
22
* {@inheritdoc}
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 \Command as BaseCommand ;
15
+ use PHPUnit \TextUI \TestRunner as BaseRunner ;
16
+ use Symfony \Bridge \PhpUnit \TextUI \TestRunner ;
17
+
18
+ /**
19
+ * {@inheritdoc}
20
+ *
21
+ * @internal
22
+ */
23
+ class CommandForV6 extends BaseCommand
24
+ {
25
+ /**
26
+ * {@inheritdoc}
27
+ */
28
+ protected function createRunner (): BaseRunner
29
+ {
30
+ return new TestRunner ($ this ->arguments ['loader ' ]);
31
+ }
32
+ }
Original file line number Diff line number Diff line change 16
16
*
17
17
* @internal
18
18
*/
19
- class TestRunner extends \PHPUnit_TextUI_TestRunner
19
+ class TestRunnerForV5 extends \PHPUnit_TextUI_TestRunner
20
20
{
21
21
/**
22
22
* {@inheritdoc}
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 TestRunnerForV6 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 11
11
12
12
namespace Symfony \Bridge \PhpUnit \TextUI ;
13
13
14
- use PHPUnit \TextUI \Command as BaseCommand ;
15
-
16
14
if (class_exists ('PHPUnit_Runner_Version ' ) && version_compare (\PHPUnit_Runner_Version::id (), '6.0.0 ' , '< ' )) {
17
- class_alias ('Symfony\Bridge\PhpUnit\Legacy\Command ' , 'Symfony\Bridge\PhpUnit\TextUI\Command ' );
15
+ class_alias ('Symfony\Bridge\PhpUnit\Legacy\CommandForV5 ' , 'Symfony\Bridge\PhpUnit\TextUI\Command ' );
18
16
} else {
19
- /**
20
- * {@inheritdoc}
21
- *
22
- * @internal
23
- */
24
- class Command extends BaseCommand
17
+ class_alias ('Symfony\Bridge\PhpUnit\Legacy\CommandForV6 ' , 'Symfony\Bridge\PhpUnit\TextUI\Command ' );
18
+ }
19
+
20
+ if (false ) {
21
+ class Command
25
22
{
26
- /**
27
- * {@inheritdoc}
28
- */
29
- protected function createRunner ()
30
- {
31
- return new TestRunner ($ this ->arguments ['loader ' ]);
32
- }
33
23
}
34
24
}
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bridge \PhpUnit \TextUI ;
13
13
14
- use PHPUnit \TextUI \TestRunner as BaseRunner ;
15
- use Symfony \Bridge \PhpUnit \SymfonyTestsListener ;
16
-
17
14
if (class_exists ('PHPUnit_Runner_Version ' ) && version_compare (\PHPUnit_Runner_Version::id (), '6.0.0 ' , '< ' )) {
18
- class_alias ('Symfony\Bridge\PhpUnit\Legacy\TestRunner ' , 'Symfony\Bridge\PhpUnit\TextUI\TestRunner ' );
15
+ class_alias ('Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV5 ' , 'Symfony\Bridge\PhpUnit\TextUI\TestRunner ' );
19
16
} else {
20
- /**
21
- * {@inheritdoc}
22
- *
23
- * @internal
24
- */
25
- class TestRunner extends BaseRunner
26
- {
27
- /**
28
- * {@inheritdoc}
29
- */
30
- protected function handleConfiguration (array &$ arguments )
31
- {
32
- $ listener = new SymfonyTestsListener ();
33
-
34
- $ result = parent ::handleConfiguration ($ arguments );
35
-
36
- $ arguments ['listeners ' ] = isset ($ arguments ['listeners ' ]) ? $ arguments ['listeners ' ] : array ();
37
-
38
- $ registeredLocally = false ;
39
-
40
- foreach ($ arguments ['listeners ' ] as $ registeredListener ) {
41
- if ($ registeredListener instanceof SymfonyTestsListener) {
42
- $ registeredListener ->globalListenerDisabled ();
43
- $ registeredLocally = true ;
44
- break ;
45
- }
46
- }
47
-
48
- if (!$ registeredLocally ) {
49
- $ arguments ['listeners ' ][] = $ listener ;
50
- }
17
+ class_alias ('Symfony\Bridge\PhpUnit\Legacy\TestRunnerForV6 ' , 'Symfony\Bridge\PhpUnit\TextUI\TestRunner ' );
18
+ }
51
19
52
- return $ result ;
53
- }
20
+ if (false ) {
21
+ class TestRunner
22
+ {
54
23
}
55
24
}
You can’t perform that action at this time.
0 commit comments