File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \Bridge \PhpUnit \Legacy ;
13
13
14
14
use PHPUnit \TextUI \Command as BaseCommand ;
15
- use PHPUnit \TextUI \Configuration \Configuration ;
15
+ use PHPUnit \TextUI \Configuration \Configuration as LegacyConfiguration ;
16
16
use PHPUnit \TextUI \Configuration \Registry ;
17
17
use PHPUnit \TextUI \TestRunner as BaseRunner ;
18
+ use PHPUnit \TextUI \XmlConfiguration \Configuration ;
19
+ use PHPUnit \TextUI \XmlConfiguration \Loader ;
18
20
use Symfony \Bridge \PhpUnit \SymfonyTestsListener ;
19
21
20
22
/**
@@ -43,9 +45,13 @@ protected function createRunner(): BaseRunner
43
45
44
46
if (isset ($ this ->arguments ['configuration ' ])) {
45
47
$ configuration = $ this ->arguments ['configuration ' ];
46
- if (!$ configuration instanceof Configuration) {
48
+
49
+ if (!class_exists (Configuration::class) && !$ configuration instanceof LegacyConfiguration) {
47
50
$ configuration = Registry::getInstance ()->get ($ this ->arguments ['configuration ' ]);
51
+ } elseif (class_exists (Configuration::class) && !$ configuration instanceof Configuration) {
52
+ $ configuration = (new Loader ())->load ($ this ->arguments ['configuration ' ]);
48
53
}
54
+
49
55
foreach ($ configuration ->listeners () as $ registeredListener ) {
50
56
if ('Symfony\Bridge\PhpUnit\SymfonyTestsListener ' === ltrim ($ registeredListener ->className (), '\\' )) {
51
57
$ registeredLocally = true ;
You can’t perform that action at this time.
0 commit comments