We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbc3580 commit 008a887Copy full SHA for 008a887
1 file changed
phpunit-patch.php
@@ -15,16 +15,13 @@
15
(function () {
16
/** @var null|ClassLoader $classLoader */
17
$classLoader = null;
18
- foreach ([
19
- __DIR__ . '/../../vendor/autoload.php',
20
- __DIR__ . '/../../autoload.php',
21
- ] as $file) {
22
- if (file_exists($file)) {
23
- $classLoader = require $file;
+ foreach (spl_autoload_functions() as $loader) {
+ if (is_array($loader) && $loader[0] instanceof ClassLoader) {
+ $classLoader = $loader[0];
24
break;
25
}
26
27
- if (! $classLoader instanceof ClassLoader) {
+ if (! $classLoader) {
28
return;
29
30
if ($file = $classLoader->findFile(TestCase::class)) {
0 commit comments