From 02d111093bb57a4d51bfa0b790f885fbdde1c06e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 8 Oct 2024 16:40:20 +0200 Subject: [PATCH] [PhpUnitBridge] Use 'total' for asserting deprecation count when a group is not defined --- src/Symfony/Bridge/PhpUnit/CHANGELOG.md | 1 + .../Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/PhpUnit/CHANGELOG.md b/src/Symfony/Bridge/PhpUnit/CHANGELOG.md index d28ee0caba7df..a2dc7bd6706e0 100644 --- a/src/Symfony/Bridge/PhpUnit/CHANGELOG.md +++ b/src/Symfony/Bridge/PhpUnit/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG --- * Add `ExpectUserDeprecationMessageTrait` with a polyfill of PHPUnit's `expectUserDeprecationMessage()` + * Use `total` for asserting deprecation count when a group is not defined 6.4 --- diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php index 32b120e10dff1..c984b73d79eac 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Configuration.php @@ -96,7 +96,7 @@ private function __construct(array $thresholds = [], string $regex = '', array $ } foreach ($groups as $group) { if (!isset($this->thresholds[$group])) { - $this->thresholds[$group] = 999999; + $this->thresholds[$group] = $this->thresholds['total'] ?? 999999; } } $this->regex = $regex;