From 9a3945487811f95f19b77ecc9e82428182263d36 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 5 Dec 2025 07:17:10 +0100 Subject: PHP 8.5: Remove ReflectionProperty::setAccessible (#8284) https://php.net/reflectionproperty.setaccessible > As of PHP 8.1.0, calling this method has no effect; all properties are accessible by default. > This function has been DEPRECATED as of PHP 8.5.0. --- tests/cli/i18n/I18nCompletionValidatorTest.php | 2 -- tests/cli/i18n/I18nUsageValidatorTest.php | 2 -- tests/cli/i18n/I18nValueTest.php | 1 - 3 files changed, 5 deletions(-) (limited to 'tests') diff --git a/tests/cli/i18n/I18nCompletionValidatorTest.php b/tests/cli/i18n/I18nCompletionValidatorTest.php index 7eb32d8a3..39baa5d69 100644 --- a/tests/cli/i18n/I18nCompletionValidatorTest.php +++ b/tests/cli/i18n/I18nCompletionValidatorTest.php @@ -20,13 +20,11 @@ final class I18nCompletionValidatorTest extends \PHPUnit\Framework\TestCase { self::assertSame("There is no data.\n", $validator->displayReport()); $reflectionTotalEntries = new ReflectionProperty(I18nCompletionValidator::class, 'totalEntries'); - $reflectionTotalEntries->setAccessible(true); $reflectionTotalEntries->setValue($validator, 100); self::assertSame("Translation is 0.0% complete.\n", $validator->displayReport()); $reflectionPassEntries = new ReflectionProperty(I18nCompletionValidator::class, 'passEntries'); - $reflectionPassEntries->setAccessible(true); $reflectionPassEntries->setValue($validator, 25); self::assertSame("Translation is 25.0% complete.\n", $validator->displayReport()); diff --git a/tests/cli/i18n/I18nUsageValidatorTest.php b/tests/cli/i18n/I18nUsageValidatorTest.php index 0d9306f87..ef8bad1f2 100644 --- a/tests/cli/i18n/I18nUsageValidatorTest.php +++ b/tests/cli/i18n/I18nUsageValidatorTest.php @@ -20,13 +20,11 @@ final class I18nUsageValidatorTest extends \PHPUnit\Framework\TestCase { self::assertSame("There is no data.\n", $validator->displayReport()); $reflectionTotalEntries = new ReflectionProperty(I18nUsageValidator::class, 'totalEntries'); - $reflectionTotalEntries->setAccessible(true); $reflectionTotalEntries->setValue($validator, 100); self::assertSame(" 0.0% of translation keys are unused.\n", $validator->displayReport()); $reflectionFailedEntries = new ReflectionProperty(I18nUsageValidator::class, 'failedEntries'); - $reflectionFailedEntries->setAccessible(true); $reflectionFailedEntries->setValue($validator, 25); self::assertSame(" 25.0% of translation keys are unused.\n", $validator->displayReport()); diff --git a/tests/cli/i18n/I18nValueTest.php b/tests/cli/i18n/I18nValueTest.php index 76bdf03d4..01fa68e12 100644 --- a/tests/cli/i18n/I18nValueTest.php +++ b/tests/cli/i18n/I18nValueTest.php @@ -58,7 +58,6 @@ final class I18nValueTest extends \PHPUnit\Framework\TestCase { public static function testStates(): void { $reflectionProperty = new ReflectionProperty(I18nValue::class, 'state'); - $reflectionProperty->setAccessible(true); $value = new I18nValue('some value'); self::assertNull($reflectionProperty->getValue($value)); -- cgit v1.2.3