Skip to content

Commit e31c924

Browse files
authored
Merge pull request #4582 from oleibman/setaccessible
Remove Reflection::setAccessible From Tests
2 parents 3174773 + 029d79c commit e31c924

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

tests/PhpSpreadsheetTests/Calculation/Issue4451Test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public static function testReflect(): void
2020
// Use reflection to make the protected method accessible
2121
$calculation = new Calculation();
2222
$reflectionMethod = new ReflectionMethod(Calculation::class, 'resizeMatricesExtend');
23-
$reflectionMethod->setAccessible(true);
2423

2524
// Call the method using reflection
2625
$reflectionMethod->invokeArgs($calculation, [&$matrix1, &$matrix2, count($matrix1), 1, count($matrix2), 1]);

tests/PhpSpreadsheetTests/Writer/Xls/WorkbookTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public function xtestAddColor(array $testColors, array $expectedResult): void
4848
$workbookReflection = new ReflectionClass(Workbook::class);
4949
$methodAddColor = $workbookReflection->getMethod('addColor');
5050
$propertyPalette = $workbookReflection->getProperty('palette');
51-
$methodAddColor->setAccessible(true);
52-
$propertyPalette->setAccessible(true);
5351

5452
foreach ($testColors as $testColor) {
5553
$methodAddColor->invoke($this->workbook, $testColor);
@@ -82,7 +80,6 @@ public function arrayAddColor(): array
8280

8381
$workbookReflection = new ReflectionClass(Workbook::class);
8482
$propertyPalette = $workbookReflection->getProperty('palette');
85-
$propertyPalette->setAccessible(true);
8683

8784
$palette = $propertyPalette->getValue($this->workbook);
8885
self::assertIsArray($palette);

0 commit comments

Comments
 (0)