Skip to content

Commit 60e0994

Browse files
authored
Merge pull request #193 from PHPCSStandards/feature/fix-test-runtime-deprecations-php-8.5
PHP 8.5 | Tests: prevent deprecation notice for Reflection*::setAccessible()
2 parents 350c5e7 + 83f47bf commit 60e0994

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/FeatureComplete/Config/GetHelpTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ public function testGetHelpWithColors()
130130
$config = new Config(new TestWriter());
131131

132132
$getHelp = new ReflectionMethod($config, 'getHelp');
133-
$getHelp->setAccessible(true);
133+
(\PHP_VERSION_ID < 80100) && $getHelp->setAccessible(true);
134134

135135
$actual = $getHelp->invoke($config);
136136
$actual = \str_replace(["\r\n", "\r"], "\n", $actual);
137137

138138
// Reset to prevent influencing other tests, even if this test would fail.
139-
$getHelp->setAccessible(false);
139+
(\PHP_VERSION_ID < 80100) && $getHelp->setAccessible(false);
140140

141141
$this->assertSame($this->expectedOutputColorized, $actual);
142142
}

0 commit comments

Comments
 (0)