@@ -40,13 +40,18 @@ private function setUpWorkbook(): void
4040 $ this ->workbook = new Workbook ($ spreadsheet , $ strTotal , $ strUnique , $ str_table , $ colors , $ parser );
4141 }
4242
43+ /** @var int */
44+ protected static $ accessibleNoop = 80100 ;
45+
4346 public function xtestAddColor (array $ testColors , array $ expectedResult ): void
4447 {
4548 $ workbookReflection = new ReflectionClass (Workbook::class);
4649 $ methodAddColor = $ workbookReflection ->getMethod ('addColor ' );
4750 $ propertyPalette = $ workbookReflection ->getProperty ('palette ' );
48- $ methodAddColor ->setAccessible (true );
49- $ propertyPalette ->setAccessible (true );
51+ if (self ::$ accessibleNoop > PHP_VERSION_ID ) {
52+ $ methodAddColor ->setAccessible (true );
53+ $ propertyPalette ->setAccessible (true );
54+ }
5055
5156 foreach ($ testColors as $ testColor ) {
5257 $ methodAddColor ->invoke ($ this ->workbook , $ testColor );
@@ -74,7 +79,9 @@ public function arrayAddColor(): array
7479
7580 $ workbookReflection = new ReflectionClass (Workbook::class);
7681 $ propertyPalette = $ workbookReflection ->getProperty ('palette ' );
77- $ propertyPalette ->setAccessible (true );
82+ if (self ::$ accessibleNoop > PHP_VERSION_ID ) {
83+ $ propertyPalette ->setAccessible (true );
84+ }
7885
7986 $ palette = $ propertyPalette ->getValue ($ this ->workbook );
8087 self ::assertIsArray ($ palette );
0 commit comments