File tree 4 files changed +20
-112
lines changed
src/Symfony/Bridge/PhpUnit
4 files changed +20
-112
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use PHPUnit \TextUI \Command as BaseCommand ;
15
15
use PHPUnit \TextUI \TestRunner as BaseRunner ;
16
- use Symfony \Bridge \PhpUnit \TextUI \ TestRunner ;
16
+ use Symfony \Bridge \PhpUnit \SymfonyTestsListener ;
17
17
18
18
/**
19
19
* {@inheritdoc}
@@ -27,6 +27,24 @@ class CommandForV6 extends BaseCommand
27
27
*/
28
28
protected function createRunner (): BaseRunner
29
29
{
30
- return new TestRunner ($ this ->arguments ['loader ' ]);
30
+ $ listener = new SymfonyTestsListener ();
31
+
32
+ $ this ->arguments ['listeners ' ] = isset ($ arguments ['listeners ' ]) ? $ this ->arguments ['listeners ' ] : array ();
33
+
34
+ $ registeredLocally = false ;
35
+
36
+ foreach ($ this ->arguments ['listeners ' ] as $ registeredListener ) {
37
+ if ($ registeredListener instanceof SymfonyTestsListener) {
38
+ $ registeredListener ->globalListenerDisabled ();
39
+
10000
$ registeredLocally = true ;
40
+ break ;
41
+ }
42
+ }
43
+
44
+ if (!$ registeredLocally ) {
45
+ $ this ->arguments ['listeners ' ][] = $ listener ;
46
+ }
47
+
48
+ return parent ::createRunner ();
31
49
}
32
50
}
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -100,18 +100,6 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
100
100
if ($ exit ) {
101
101
exit ($ exit );
102
102
}
103
- if ($ PHPUNIT_VERSION >= 8.0 ) {
104
- // Fix compatibility to custom TestRunner for PhpUnit 8
105
- $ testRunnerFile = 'src/TextUI/TestRunner.php ' ;
106
- file_put_contents (
107
- $ testRunnerFile ,
108
- str_replace (
109
- 'final class TestRunner ' ,
110
- 'class TestRunner ' ,
111
- file_get_contents ($ testRunnerFile )
112
- )
113
- );
114
- }
115
103
file_put_contents ('phpunit ' , <<<'EOPHP'
116
104
<?php
117
105
You can’t perform that action at this time.
0 commit comments