Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f29cec4

Browse files
committed
Enabling the DebugClassLoader available
1 parent ca9ad2b commit f29cec4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use PHPUnit\Util\Blacklist;
1919
use Symfony\Bridge\PhpUnit\ClockMock;
2020
use Symfony\Bridge\PhpUnit\DnsMock;
21+
use Symfony\Component\Debug\DebugClassLoader as DebugDebugClassLoader;
2122
use Symfony\Component\ErrorHandler\DebugClassLoader;
2223

2324
/**
@@ -53,8 +54,6 @@ public function __construct(array $mockedNamespaces = array())
5354
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait'] = 2;
5455
}
5556

56-
$enableDebugClassLoader = class_exists('Symfony\Component\ErrorHandler\DebugClassLoader');
57-
5857
foreach ($mockedNamespaces as $type => $namespaces) {
5958
if (!\is_array($namespaces)) {
6059
$namespaces = array($namespaces);
@@ -73,8 +72,10 @@ public function __construct(array $mockedNamespaces = array())
7372
$enableDebugClassLoader = $namespaces && $namespaces[0];
7473
}
7574
}
76-
if ($enableDebugClassLoader) {
75+
if (class_exists('Symfony\Component\ErrorHandler\DebugClassLoader')) {
7776
DebugClassLoader::enable();
77+
} elseif (class_exists('Symfony\Component\Debug\DebugClassLoader')) {
78+
DebugDebugClassLoader::enable();
7879
}
7980
if (self::$globallyEnabled) {
8081
$this->state = -2;

0 commit comments

Comments
 (0)