From ee3a3ef5faadb42da1d6a13120d8bc3ff85a396f Mon Sep 17 00:00:00 2001
From: rxu <rxu@mail.ru>
Date: Sat, 5 Dec 2020 15:19:45 +0700
Subject: [PATCH] [ticket/16648] Fix possible Access to undeclared static
 property error in tests

PHPBB3-16648
---
 tests/test_framework/phpbb_test_case_helpers.php | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 347f70f3c9..11a5836fe1 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -81,12 +81,20 @@ class phpbb_test_case_helpers
 		{
 			case E_NOTICE:
 			case E_STRICT:
-				PHPUnit\Framework\Error\Notice::$enabled = true;
+				// The static property was removed from PHPUnit since v.8.3.0
+				if (isset(PHPUnit\Framework\Error\Notice::$enabled))
+				{
+					PHPUnit\Framework\Error\Notice::$enabled = true;
+				}
 				$exceptionName = 'PHPUnit\Framework\Error\Notice';
 			break;
 
 			case E_WARNING:
-				PHPUnit\Framework\Error\Warning::$enabled = true;
+				// The static property was removed from PHPUnit since v.8.3.0
+				if (isset(PHPUnit\Framework\Error\Warning::$enabled))
+				{
+					PHPUnit\Framework\Error\Warning::$enabled = true;
+				}
 				$exceptionName = 'PHPUnit\Framework\Error\Warning';
 			break;