diff --git a/src/Testing/PHPUnit/AbstractLazyTestCase.php b/src/Testing/PHPUnit/AbstractLazyTestCase.php index 720990bc0ac..1beba2eaf45 100644 --- a/src/Testing/PHPUnit/AbstractLazyTestCase.php +++ b/src/Testing/PHPUnit/AbstractLazyTestCase.php @@ -61,7 +61,9 @@ protected function isWindows(): bool private function includePreloadFilesAndScoperAutoload(): void { - if (file_exists(__DIR__ . '/../../../preload.php')) { + if (\file_exists(__DIR__ . '/../../../vendor/scoper-autoload.php')) { + require_once __DIR__ . '/../../../vendor/scoper-autoload.php'; + } elseif (file_exists(__DIR__ . '/../../../preload.php')) { if (file_exists(__DIR__ . '/../../../vendor')) { require_once __DIR__ . '/../../../preload.php'; // test case in rector split package @@ -69,9 +71,5 @@ private function includePreloadFilesAndScoperAutoload(): void require_once __DIR__ . '/../../../preload-split-package.php'; } } - - if (\file_exists(__DIR__ . '/../../../vendor/scoper-autoload.php')) { - require_once __DIR__ . '/../../../vendor/scoper-autoload.php'; - } } }