File tree 1 file changed +7
-2
lines changed
src/Symfony/Bridge/PhpUnit/Legacy
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 18
18
use PHPUnit \Util \Blacklist ;
19
19
use Symfony \Bridge \PhpUnit \ClockMock ;
20
20
use Symfony \Bridge \PhpUnit \DnsMock ;
21
+ use Symfony \Component \Debug \DebugClassLoader as LegacyDebugClassLoader ;
21
22
use Symfony \Component \ErrorHandler \DebugClassLoader ;
22
23
23
24
/**
@@ -53,7 +54,7 @@ public function __construct(array $mockedNamespaces = array())
53
54
Blacklist::$ blacklistedClassNames ['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait ' ] = 2 ;
54
55
}
55
56
56
- $ enableDebugClassLoader = class_exists ('Symfony\Component\ErrorHandler\DebugClassLoader ' );
57
+ $ enableDebugClassLoader = class_exists ('Symfony\Component\ErrorHandler\DebugClassLoader ' ) || class_exists ( ' Symfony\Component\Debug\DebugClassLoader ' ) ;
57
58
58
59
foreach ($ mockedNamespaces as $ type => $ namespaces ) {
59
60
if (!\is_array ($ namespaces )) {
@@ -74,7 +75,11 @@ public function __construct(array $mockedNamespaces = array())
74
75
}
75
76
}
76
77
if ($ enableDebugClassLoader ) {
77
- DebugClassLoader::enable ();
78
+ if (class_exists (DebugClassLoader::class)) {
79
+ DebugClassLoader::enable ();
80
+ } else {
81
+ LegacyDebugClassLoader::enable ();
82
+ }
78
83
}
79
84
if (self ::$ globallyEnabled ) {
80
85
$ this ->state = -2 ;
You can’t perform that action at this time.
0 commit comments