File tree Expand file tree Collapse file tree 4 files changed +20
-112
lines changed
src/Symfony/Bridge/PhpUnit Expand file tree Collapse file tree 4 files changed +20
-112
lines changed Original file line number Diff line number Diff line change 1313
1414use PHPUnit \TextUI \Command as BaseCommand ;
1515use PHPUnit \TextUI \TestRunner as BaseRunner ;
16- use Symfony \Bridge \PhpUnit \TextUI \ TestRunner ;
16+ use Symfony \Bridge \PhpUnit \SymfonyTestsListener ;
1717
1818/**
1919 * {@inheritdoc}
@@ -27,6 +27,24 @@ class CommandForV6 extends BaseCommand
2727 */
2828 protected function createRunner (): BaseRunner
2929 {
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+ $ registeredLocally = true ;
40+ break ;
41+ }
42+ }
43+
44+ if (!$ registeredLocally ) {
45+ $ this ->arguments ['listeners ' ][] = $ listener ;
46+ }
47+
48+ return parent ::createRunner ();
3149 }
3250}
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(__
100100 if ($ exit ) {
101101 exit ($ exit );
102102 }
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- }
115103 file_put_contents ('phpunit ' , <<<'EOPHP'
116104<?php
117105
You can’t perform that action at this time.
0 commit comments