From b95dfede5f06147dd08ed0056c5a21b9f1e16db8 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 2 Jul 2021 17:57:26 +0200 Subject: [PATCH] Avoid triggering the autoloader in Deprecation::isLegacy() Signed-off-by: Alexander M. Turek --- .../Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php index 254b84f729..e41a192f51 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php @@ -20,6 +20,8 @@ use Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerFor; use Symfony\Component\Debug\DebugClassLoader as LegacyDebugClassLoader; use Symfony\Component\ErrorHandler\DebugClassLoader; +class_exists(Groups::class); + /** * @internal */ @@ -194,7 +196,7 @@ class Deprecation } $method = $this->originatingMethod(); - $groups = class_exists(Groups::class) ? [new Groups(), 'groups'] : [Test::class, 'getGroups']; + $groups = class_exists(Groups::class, false) ? [new Groups(), 'groups'] : [Test::class, 'getGroups']; return 0 === strpos($method, 'testLegacy') || 0 === strpos($method, 'provideLegacy')