From 86ef9e9d23b77b3c957e785070af598708c3371b Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 11 Oct 2025 22:11:56 +0700 Subject: [PATCH] Revert "Fix global require-dev phpunit 12 (#7475)" This reverts commit ad2862daff710eff6323a6cd2c41755b7ceb2e26. --- scoper.php | 1 - src/Testing/PHPUnit/AbstractLazyTestCase.php | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/scoper.php b/scoper.php index e8893e4b34f..73d00ecf873 100644 --- a/scoper.php +++ b/scoper.php @@ -33,7 +33,6 @@ 'exclude-classes' => [ 'PHPUnit\Framework\Constraint\IsEqual', 'PHPUnit\Framework\TestCase', - 'PHPUnit\Runner\Version', 'PHPUnit\Framework\ExpectationFailedException', // native class on php 8.3+ diff --git a/src/Testing/PHPUnit/AbstractLazyTestCase.php b/src/Testing/PHPUnit/AbstractLazyTestCase.php index f4236153043..720990bc0ac 100644 --- a/src/Testing/PHPUnit/AbstractLazyTestCase.php +++ b/src/Testing/PHPUnit/AbstractLazyTestCase.php @@ -5,7 +5,6 @@ namespace Rector\Testing\PHPUnit; use PHPUnit\Framework\TestCase; -use PHPUnit\Runner\Version; use Rector\Config\RectorConfig; use Rector\DependencyInjection\LazyContainerFactory; @@ -64,12 +63,7 @@ private function includePreloadFilesAndScoperAutoload(): void { if (file_exists(__DIR__ . '/../../../preload.php')) { if (file_exists(__DIR__ . '/../../../vendor')) { - /** - * On PHPUnit 12+, when classmap autoloaded, it means preload already loaded early - */ - if (! class_exists(Version::class, true) || (int) Version::id() < 12) { - require_once __DIR__ . '/../../../preload.php'; - } + require_once __DIR__ . '/../../../preload.php'; // test case in rector split package } elseif (file_exists(__DIR__ . '/../../../../../../vendor')) { require_once __DIR__ . '/../../../preload-split-package.php';