@@ -20,7 +20,6 @@ public function testAddOption(): void
2020 $ this ->assertEquals ([], $ media ->getOptions ());
2121
2222 $ r = new ReflectionMethod ($ media , 'addOption ' );
23- $ r ->setAccessible (true );
2423 $ r ->invokeArgs ($ media , ['foo ' , 'bar ' ]);
2524
2625 $ this ->assertEquals (['foo ' => 'bar ' ], $ media ->getOptions (), '->addOption() adds an option ' );
@@ -54,7 +53,6 @@ public function testAddOptions(): void
5453 $ this ->assertEquals ([], $ media ->getOptions ());
5554
5655 $ r = new ReflectionMethod ($ media , 'addOptions ' );
57- $ r ->setAccessible (true );
5856 $ r ->invokeArgs ($ media , [['foo ' => 'bar ' , 'baz ' => 'bat ' ]]);
5957
6058 $ this ->assertEquals (
@@ -106,7 +104,6 @@ public function testSetOption(): void
106104 $ logger ->expects ($ this ->once ())->method ('debug ' );
107105
108106 $ r = new ReflectionMethod ($ media , 'addOption ' );
109- $ r ->setAccessible (true );
110107 $ r ->invokeArgs ($ media , ['foo ' , 'bar ' ]);
111108
112109 $ media ->setOption ('foo ' , 'abc ' );
@@ -145,7 +142,6 @@ public function testSetOptions(): void
145142 $ logger ->expects ($ this ->exactly (4 ))->method ('debug ' );
146143
147144 $ r = new ReflectionMethod ($ media , 'addOptions ' );
148- $ r ->setAccessible (true );
149145 $ r ->invokeArgs ($ media , [['foo ' => 'bar ' , 'baz ' => 'bat ' ]]);
150146
151147 $ media ->setOptions (['foo ' => 'abc ' , 'baz ' => 'def ' ]);
@@ -506,11 +502,9 @@ public function testMergeOptions(): void
506502 $ originalOptions = ['foo ' => 'bar ' , 'baz ' => 'bat ' ];
507503
508504 $ addOptions = new ReflectionMethod ($ media , 'addOptions ' );
509- $ addOptions ->setAccessible (true );
510505 $ addOptions ->invokeArgs ($ media , [$ originalOptions ]);
511506
512507 $ r = new ReflectionMethod ($ media , 'mergeOptions ' );
513- $ r ->setAccessible (true );
514508
515509 $ mergedOptions = $ r ->invokeArgs ($ media , [['foo ' => 'ban ' ]]);
516510
@@ -559,7 +553,6 @@ public function testBuildCommand(string $binary, string $url, string $path, arra
559553 $ media = $ this ->getMockForAbstractClass (AbstractGenerator::class, [], '' , false );
560554
561555 $ r = new ReflectionMethod ($ media , 'buildCommand ' );
562- $ r ->setAccessible (true );
563556
564557 $ this ->assertEquals ($ expected , $ r ->invokeArgs ($ media , [$ binary , $ url , $ path , $ options ]));
565558 }
@@ -656,7 +649,6 @@ public function testCheckOutput(): void
656649 ;
657650
658651 $ r = new ReflectionMethod ($ media , 'checkOutput ' );
659- $ r ->setAccessible (true );
660652
661653 $ message = '->checkOutput() checks both file existence and size ' ;
662654
@@ -687,7 +679,6 @@ public function testCheckOutputWhenTheFileDoesNotExist(): void
687679 ;
688680
689681 $ r = new ReflectionMethod ($ media , 'checkOutput ' );
690- $ r ->setAccessible (true );
691682
692683 $ message = '->checkOutput() throws an InvalidArgumentException when the file does not exist ' ;
693684
@@ -725,7 +716,6 @@ public function testCheckOutputWhenTheFileIsEmpty(): void
725716 ;
726717
727718 $ r = new ReflectionMethod ($ media , 'checkOutput ' );
728- $ r ->setAccessible (true );
729719
730720 $ message = '->checkOutput() throws an InvalidArgumentException when the file is empty ' ;
731721
@@ -746,7 +736,6 @@ public function testCheckProcessStatus(): void
746736 ;
747737
748738 $ r = new ReflectionMethod ($ media , 'checkProcessStatus ' );
749- $ r ->setAccessible (true );
750739
751740 try {
752741 $ r ->invokeArgs ($ media , [0 , '' , '' , 'the command ' ]);
@@ -778,7 +767,6 @@ public function testIsAssociativeArray(array $array, bool $isAssociativeArray):
778767 $ generator = $ this ->getMockForAbstractClass (AbstractGenerator::class, [], '' , false );
779768
780769 $ r = new ReflectionMethod ($ generator , 'isAssociativeArray ' );
781- $ r ->setAccessible (true );
782770 $ this ->assertEquals ($ isAssociativeArray , $ r ->invokeArgs ($ generator , [$ array ]));
783771 }
784772
@@ -807,7 +795,6 @@ public function testItThrowsTheProperExceptionWhenFileExistsAndNotOverwritting()
807795 ->will ($ this ->returnValue (true ))
808796 ;
809797 $ r = new ReflectionMethod ($ media , 'prepareOutput ' );
810- $ r ->setAccessible (true );
811798
812799 $ r ->invokeArgs ($ media , ['' , false ]);
813800 }
@@ -867,15 +854,12 @@ public function testCleanupEmptyTemporaryFiles(): void
867854 ;
868855
869856 $ create = new ReflectionMethod ($ generator , 'createTemporaryFile ' );
870- $ create ->setAccessible (true );
871857 $ create ->invoke ($ generator , null , null );
872858
873859 $ files = new ReflectionProperty ($ generator , 'temporaryFiles ' );
874- $ files ->setAccessible (true );
875860 $ this ->assertCount (1 , $ files ->getValue ($ generator ));
876861
877862 $ remove = new ReflectionMethod ($ generator , 'removeTemporaryFiles ' );
878- $ remove ->setAccessible (true );
879863 $ remove ->invoke ($ generator );
880864 }
881865
@@ -896,15 +880,12 @@ public function testleanupTemporaryFiles(): void
896880 ;
897881
898882 $ create = new ReflectionMethod ($ generator , 'createTemporaryFile ' );
899- $ create ->setAccessible (true );
900883 $ create ->invoke ($ generator , '<html/> ' , 'html ' );
901884
902885 $ files = new ReflectionProperty ($ generator , 'temporaryFiles ' );
903- $ files ->setAccessible (true );
904886 $ this ->assertCount (1 , $ files ->getValue ($ generator ));
905887
906888 $ remove = new ReflectionMethod ($ generator , 'removeTemporaryFiles ' );
907- $ remove ->setAccessible (true );
908889 $ remove ->invoke ($ generator );
909890 }
910891
0 commit comments