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

Skip to content

Commit 8201718

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 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 LegacyDebugClassLoader;
2122
use Symfony\Component\ErrorHandler\DebugClassLoader;
2223

2324
/**
@@ -53,7 +54,7 @@ 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+
$enableDebugClassLoader = class_exists('Symfony\Component\ErrorHandler\DebugClassLoader') || class_exists('Symfony\Component\Debug\DebugClassLoader');
5758

5859
foreach ($mockedNamespaces as $type => $namespaces) {
5960
if (!\is_array($namespaces)) {
@@ -74,7 +75,11 @@ public function __construct(array $mockedNamespaces = array())
7475
}
7576
}
7677
if ($enableDebugClassLoader) {
77-
DebugClassLoader::enable();
78+
if (class_exists(DebugClassLoader::class)) {
79+
DebugClassLoader::enable();
80+
} else {
81+
LegacyDebugClassLoader::enable();
82+
}
7883
}
7984
if (self::$globallyEnabled) {
8085
$this->state = -2;

0 commit comments

Comments
 (0)