Merge pull request #4582 from oleibman/setaccessible

Remove Reflection::setAccessible From Tests
This commit is contained in:
oleibman
2025-08-18 06:43:32 +00:00
committed by GitHub
2 changed files with 0 additions and 4 deletions
@@ -20,7 +20,6 @@ class Issue4451Test extends TestCase
// Use reflection to make the protected method accessible
$calculation = new Calculation();
$reflectionMethod = new ReflectionMethod(Calculation::class, 'resizeMatricesExtend');
$reflectionMethod->setAccessible(true);
// Call the method using reflection
$reflectionMethod->invokeArgs($calculation, [&$matrix1, &$matrix2, count($matrix1), 1, count($matrix2), 1]);
@@ -48,8 +48,6 @@ class WorkbookTest extends TestCase
$workbookReflection = new ReflectionClass(Workbook::class);
$methodAddColor = $workbookReflection->getMethod('addColor');
$propertyPalette = $workbookReflection->getProperty('palette');
$methodAddColor->setAccessible(true);
$propertyPalette->setAccessible(true);
foreach ($testColors as $testColor) {
$methodAddColor->invoke($this->workbook, $testColor);
@@ -82,7 +80,6 @@ class WorkbookTest extends TestCase
$workbookReflection = new ReflectionClass(Workbook::class);
$propertyPalette = $workbookReflection->getProperty('palette');
$propertyPalette->setAccessible(true);
$palette = $propertyPalette->getValue($this->workbook);
self::assertIsArray($palette);