diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 90886edf9059..772d4295d3ce 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -15996,11 +15996,6 @@ $http_response_code_param - - setAccessible - setAccessible - setAccessible - @@ -16010,9 +16005,6 @@ - - setAccessible - @@ -16134,33 +16126,6 @@ - - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - - - - - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - @@ -16200,9 +16165,6 @@ sessionID]]> - - setAccessible - @@ -16259,9 +16221,6 @@ $json - - setAccessible - @@ -16313,19 +16272,6 @@ [$currentTable, , , , , , $sumSize] [$currentTable] - - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - @@ -16411,11 +16357,6 @@ [$formattedValue, $isHtmlFormatted] [$formattedValue, $isHtmlFormatted] - - setAccessible - setAccessible - setAccessible - @@ -16425,9 +16366,6 @@ expects - - setAccessible - @@ -16457,16 +16395,6 @@ expects - - - setAccessible - - - - - setAccessible - - testPopulateRequestWithEncryptedQueryParamsWithInvalidParam @@ -16608,9 +16536,6 @@ $result - - setAccessible - @@ -17039,9 +16964,6 @@ testGenerateParams testScaleRow - - setAccessible - @@ -17216,9 +17138,6 @@ (string) gmdate(DATE_RFC1123) - - setAccessible - @@ -17349,12 +17268,6 @@ array - - setAccessible - setAccessible - setAccessible - setAccessible - @@ -17496,11 +17409,6 @@ assertIsArray - - - setAccessible - - assertIsArray @@ -17570,11 +17478,6 @@ assertIsString - - setAccessible - setAccessible - setAccessible - @@ -17591,16 +17494,6 @@ $result $result - - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - @@ -17612,10 +17505,6 @@ $property $property - - setAccessible - setAccessible - @@ -17624,10 +17513,6 @@ $property $property - - setAccessible - setAccessible - @@ -17639,18 +17524,6 @@ $property $result - - setAccessible - setAccessible - setAccessible - setAccessible - - - - - setAccessible - setAccessible - @@ -17679,19 +17552,12 @@ - - setAccessible - $property $property - - setAccessible - setAccessible - @@ -17701,10 +17567,6 @@ $property $property - - setAccessible - setAccessible - @@ -17732,32 +17594,12 @@ - - setAccessible - setAccessible - setAccessible - $generalOptions $property - - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - - - - - setAccessible - setAccessible - @@ -17809,15 +17651,6 @@ - - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - setAccessible - @@ -17825,10 +17658,6 @@ $property $property - - setAccessible - setAccessible - @@ -17841,16 +17670,6 @@ $property $property - - setAccessible - setAccessible - - - - - setAccessible - setAccessible - @@ -17976,12 +17795,6 @@ getProperties removeProperty - - setAccessible - setAccessible - setAccessible - setAccessible - @@ -18025,12 +17838,6 @@ array - - - setAccessible - setAccessible - - assertIsArray @@ -18060,9 +17867,6 @@ getMessage getMessage - - setAccessible - $password $routinename @@ -18086,12 +17890,6 @@ $result $result - - setAccessible - setAccessible - setAccessible - setAccessible - @@ -18302,9 +18100,6 @@ $data[0] $fetchArrayReturn[0] - - setAccessible - diff --git a/test/classes/AbstractNetworkTestCase.php b/test/classes/AbstractNetworkTestCase.php index c7894ff2e024..d8a8de6b6331 100644 --- a/test/classes/AbstractNetworkTestCase.php +++ b/test/classes/AbstractNetworkTestCase.php @@ -87,7 +87,6 @@ public function mockResponse(...$param): MockObject } $attrInstance = new ReflectionProperty(ResponseRenderer::class, 'instance'); - $attrInstance->setAccessible(true); $attrInstance->setValue($mockResponse); return $mockResponse; @@ -100,8 +99,6 @@ protected function tearDown(): void { parent::tearDown(); $response = new ReflectionProperty(ResponseRenderer::class, 'instance'); - $response->setAccessible(true); $response->setValue(null); - $response->setAccessible(false); } } diff --git a/test/classes/AbstractTestCase.php b/test/classes/AbstractTestCase.php index 2958d1f1f369..4d2bb8f98596 100644 --- a/test/classes/AbstractTestCase.php +++ b/test/classes/AbstractTestCase.php @@ -226,7 +226,6 @@ protected function callFunction($object, string $className, string $methodName, { $class = new ReflectionClass($className); $method = $class->getMethod($methodName); - $method->setAccessible(true); return $method->invokeArgs($object, $params); } diff --git a/test/classes/Config/FormDisplayTest.php b/test/classes/Config/FormDisplayTest.php index 2c13c5fd3614..a1f8851144af 100644 --- a/test/classes/Config/FormDisplayTest.php +++ b/test/classes/Config/FormDisplayTest.php @@ -55,7 +55,6 @@ public function testRegisterForm(): void $reflection = new ReflectionClass(FormDisplay::class); $attrForms = $reflection->getProperty('forms'); - $attrForms->setAccessible(true); $array = [ 'Servers' => [ @@ -71,7 +70,6 @@ public function testRegisterForm(): void $this->assertInstanceOf(Form::class, $_forms['pma_testform']); $attrSystemPaths = $reflection->getProperty('systemPaths'); - $attrSystemPaths->setAccessible(true); $this->assertEquals( [ @@ -82,7 +80,6 @@ public function testRegisterForm(): void ); $attrTranslatedPaths = $reflection->getProperty('translatedPaths'); - $attrTranslatedPaths->setAccessible(true); $this->assertEquals( [ @@ -110,7 +107,6 @@ public function testProcess(): void ->getMock(); $attrForms = new ReflectionProperty(FormDisplay::class, 'forms'); - $attrForms->setAccessible(true); $attrForms->setValue($this->object, [1, 2, 3]); $this->object->expects($this->once()) @@ -137,11 +133,9 @@ public function testDisplayErrors(): void $reflection = new ReflectionClass(FormDisplay::class); $attrIsValidated = $reflection->getProperty('isValidated'); - $attrIsValidated->setAccessible(true); $attrIsValidated->setValue($this->object, true); $attrIsValidated = $reflection->getProperty('errors'); - $attrIsValidated->setAccessible(true); $attrIsValidated->setValue($this->object, []); $result = $this->object->displayErrors(); @@ -159,7 +153,6 @@ public function testDisplayErrors(): void $sysArr = ['Servers/1/test' => 'Servers/1/test2']; $attrSystemPaths = $reflection->getProperty('systemPaths'); - $attrSystemPaths->setAccessible(true); $attrSystemPaths->setValue($this->object, $sysArr); $attrIsValidated->setValue($this->object, $arr); @@ -181,11 +174,9 @@ public function testFixErrors(): void $reflection = new ReflectionClass(FormDisplay::class); $attrIsValidated = $reflection->getProperty('isValidated'); - $attrIsValidated->setAccessible(true); $attrIsValidated->setValue($this->object, true); $attrIsValidated = $reflection->getProperty('errors'); - $attrIsValidated->setAccessible(true); $attrIsValidated->setValue($this->object, []); $this->object->fixErrors(); @@ -202,7 +193,6 @@ public function testFixErrors(): void $sysArr = ['Servers/1/test' => 'Servers/1/host']; $attrSystemPaths = $reflection->getProperty('systemPaths'); - $attrSystemPaths->setAccessible(true); $attrSystemPaths->setValue($this->object, $sysArr); $attrIsValidated->setValue($this->object, $arr); @@ -225,7 +215,6 @@ public function testFixErrors(): void public function testValidateSelect(): void { $attrValidateSelect = new ReflectionMethod(FormDisplay::class, 'validateSelect'); - $attrValidateSelect->setAccessible(true); $arr = ['foo' => 'var']; $value = 'foo'; @@ -286,7 +275,6 @@ public function testValidateSelect(): void public function testHasErrors(): void { $attrErrors = new ReflectionProperty(FormDisplay::class, 'errors'); - $attrErrors->setAccessible(true); $this->assertFalse( $this->object->hasErrors() @@ -333,7 +321,6 @@ public function testGetDocLink(): void public function testGetOptName(): void { $method = new ReflectionMethod(FormDisplay::class, 'getOptName'); - $method->setAccessible(true); $this->assertEquals( 'Servers_', @@ -352,11 +339,9 @@ public function testGetOptName(): void public function testLoadUserprefsInfo(): void { $method = new ReflectionMethod(FormDisplay::class, 'loadUserprefsInfo'); - $method->setAccessible(true); $attrUserprefs = new ReflectionProperty(FormDisplay::class, 'userprefsDisallow'); - $attrUserprefs->setAccessible(true); $method->invoke($this->object, null); $this->assertEquals( [], @@ -370,7 +355,6 @@ public function testLoadUserprefsInfo(): void public function testSetComments(): void { $method = new ReflectionMethod(FormDisplay::class, 'setComments'); - $method->setAccessible(true); // recoding $opts = ['values' => []]; diff --git a/test/classes/Config/FormTest.php b/test/classes/Config/FormTest.php index 9152dfec19e4..47ac3f669075 100644 --- a/test/classes/Config/FormTest.php +++ b/test/classes/Config/FormTest.php @@ -68,7 +68,6 @@ public function testContructor(): void public function testGetOptionType(): void { $attrFieldsTypes = new ReflectionProperty(Form::class, 'fieldsTypes'); - $attrFieldsTypes->setAccessible(true); $attrFieldsTypes->setValue( $this->object, ['7' => 'Seven'] @@ -124,7 +123,6 @@ public function testReadFormPathsCallBack(): void { $reflection = new ReflectionClass(Form::class); $method = $reflection->getMethod('readFormPathsCallback'); - $method->setAccessible(true); $array = [ 'foo' => [ @@ -160,7 +158,6 @@ public function testReadFormPaths(): void { $reflection = new ReflectionClass(Form::class); $method = $reflection->getMethod('readFormPaths'); - $method->setAccessible(true); $array = [ 'foo' => [ @@ -200,7 +197,6 @@ public function testReadTypes(): void { $reflection = new ReflectionClass(Form::class); $method = $reflection->getMethod('readTypes'); - $method->setAccessible(true); $this->object->fields = [ 'pma_form1' => 'Servers/1/port', @@ -210,7 +206,6 @@ public function testReadTypes(): void ]; $attrFieldsTypes = $reflection->getProperty('fieldsTypes'); - $attrFieldsTypes->setAccessible(true); $method->invoke($this->object, null); diff --git a/test/classes/Config/ServerConfigChecksTest.php b/test/classes/Config/ServerConfigChecksTest.php index 2d26e221b596..3a534de827ef 100644 --- a/test/classes/Config/ServerConfigChecksTest.php +++ b/test/classes/Config/ServerConfigChecksTest.php @@ -39,7 +39,6 @@ protected function setUp(): void $GLOBALS['ConfigFile'] = $cf; $reflection = new ReflectionProperty(ConfigFile::class, 'id'); - $reflection->setAccessible(true); $this->sessionID = $reflection->getValue($cf); unset($_SESSION['messages']); diff --git a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php index b723148042c1..11f4af1ede99 100644 --- a/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php +++ b/test/classes/Controllers/Database/Structure/FavoriteTableControllerTest.php @@ -51,7 +51,6 @@ public function testSynchronizeFavoriteTables(): void $class = new ReflectionClass(FavoriteTableController::class); $method = $class->getMethod('synchronizeFavoriteTables'); - $method->setAccessible(true); $controller = new FavoriteTableController( new ResponseStub(), diff --git a/test/classes/Controllers/Database/StructureControllerTest.php b/test/classes/Controllers/Database/StructureControllerTest.php index fbf37a8a3852..7e710d4c50be 100644 --- a/test/classes/Controllers/Database/StructureControllerTest.php +++ b/test/classes/Controllers/Database/StructureControllerTest.php @@ -77,7 +77,6 @@ public function testGetValuesForInnodbTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('getValuesForInnodbTable'); - $method->setAccessible(true); $controller = new StructureController( $this->response, $this->template, @@ -87,7 +86,6 @@ public function testGetValuesForInnodbTable(): void ); // Showing statistics $property = $class->getProperty('isShowStats'); - $property->setAccessible(true); $property->setValue($controller, true); $GLOBALS['cfg']['MaxExactCount'] = 10; @@ -148,7 +146,6 @@ public function testGetValuesForAriaTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('getValuesForAriaTable'); - $method->setAccessible(true); $controller = new StructureController( $this->response, @@ -159,10 +156,8 @@ public function testGetValuesForAriaTable(): void ); // Showing statistics $property = $class->getProperty('isShowStats'); - $property->setAccessible(true); $property->setValue($controller, true); $property = $class->getProperty('dbIsSystemSchema'); - $property->setAccessible(true); $property->setValue($controller, true); $currentTable = [ @@ -252,7 +247,6 @@ public function testHasTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('hasTable'); - $method->setAccessible(true); $controller = new StructureController( $this->response, @@ -287,7 +281,6 @@ public function testCheckFavoriteTable(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('checkFavoriteTable'); - $method->setAccessible(true); $controller = new StructureController( $this->response, @@ -320,7 +313,6 @@ public function testDisplayTableList(): void { $class = new ReflectionClass(StructureController::class); $method = $class->getMethod('displayTableList'); - $method->setAccessible(true); $controller = new StructureController( $this->response, @@ -332,14 +324,11 @@ public function testDisplayTableList(): void // Showing statistics $class = new ReflectionClass(StructureController::class); $showStatsProperty = $class->getProperty('isShowStats'); - $showStatsProperty->setAccessible(true); $showStatsProperty->setValue($controller, true); $tablesProperty = $class->getProperty('tables'); - $tablesProperty->setAccessible(true); $numTables = $class->getProperty('numTables'); - $numTables->setAccessible(true); $numTables->setValue($controller, 1); //no tables diff --git a/test/classes/Controllers/Server/VariablesControllerTest.php b/test/classes/Controllers/Server/VariablesControllerTest.php index dde90e7ca519..51f4430bb7cd 100644 --- a/test/classes/Controllers/Server/VariablesControllerTest.php +++ b/test/classes/Controllers/Server/VariablesControllerTest.php @@ -154,7 +154,6 @@ public function testFormatVariable(): void ->willReturnOnConsecutiveCalls('byte', 'string'); $response = new ReflectionProperty(ServerVariablesProvider::class, 'instance'); - $response->setAccessible(true); $response->setValue($voidProviderMock); [$formattedValue, $isHtmlFormatted] = $this->callFunction( @@ -206,7 +205,6 @@ public function testFormatVariableMariaDbMySqlKbs(): void } $response = new ReflectionProperty(ServerVariablesProvider::class, 'instance'); - $response->setAccessible(true); $response->setValue(null); $controller = new VariablesController(ResponseRenderer::getInstance(), new Template(), $GLOBALS['dbi']); @@ -265,7 +263,6 @@ public function testFormatVariableMariaDbMySqlKbs(): void public function testFormatVariableVoidProvider(): void { $response = new ReflectionProperty(ServerVariablesProvider::class, 'instance'); - $response->setAccessible(true); $response->setValue(new ServerVariablesVoidProvider()); $controller = new VariablesController(ResponseRenderer::getInstance(), new Template(), $GLOBALS['dbi']); diff --git a/test/classes/Controllers/Table/IndexesControllerTest.php b/test/classes/Controllers/Table/IndexesControllerTest.php index d099e1959d7a..0064656a4d86 100644 --- a/test/classes/Controllers/Table/IndexesControllerTest.php +++ b/test/classes/Controllers/Table/IndexesControllerTest.php @@ -102,7 +102,6 @@ public function testDisplayFormAction(): void $template = new Template(); $method = new ReflectionMethod(IndexesController::class, 'displayForm'); - $method->setAccessible(true); $ctrl = new IndexesController( $response, diff --git a/test/classes/Controllers/Table/Structure/ChangeControllerTest.php b/test/classes/Controllers/Table/Structure/ChangeControllerTest.php index b944dd1248fc..38d483486e7b 100644 --- a/test/classes/Controllers/Table/Structure/ChangeControllerTest.php +++ b/test/classes/Controllers/Table/Structure/ChangeControllerTest.php @@ -48,7 +48,6 @@ public function testChangeController(): void $class = new ReflectionClass(ChangeController::class); $method = $class->getMethod('displayHtmlForColumnChange'); - $method->setAccessible(true); $ctrl = new ChangeController( $response, diff --git a/test/classes/Controllers/Table/Structure/SaveControllerTest.php b/test/classes/Controllers/Table/Structure/SaveControllerTest.php index a61a2fc9718f..8d89061e0225 100644 --- a/test/classes/Controllers/Table/Structure/SaveControllerTest.php +++ b/test/classes/Controllers/Table/Structure/SaveControllerTest.php @@ -112,7 +112,6 @@ public function testAdjustColumnPrivileges(): void $class = new ReflectionClass(SaveController::class); $method = $class->getMethod('adjustColumnPrivileges'); - $method->setAccessible(true); $ctrl = new SaveController( new ResponseRenderer(), diff --git a/test/classes/Database/DesignerTest.php b/test/classes/Database/DesignerTest.php index 63df623eb5ae..41fbee52fd85 100644 --- a/test/classes/Database/DesignerTest.php +++ b/test/classes/Database/DesignerTest.php @@ -106,7 +106,6 @@ public function testGetPageIdsAndNames(): void $this->designer = new Designer($GLOBALS['dbi'], new Relation($GLOBALS['dbi']), new Template()); $method = new ReflectionMethod(Designer::class, 'getPageIdsAndNames'); - $method->setAccessible(true); $result = $method->invokeArgs($this->designer, [$db]); $this->assertEquals( diff --git a/test/classes/Gis/GisGeomTestCase.php b/test/classes/Gis/GisGeomTestCase.php index d66cdb19ac80..187cf9cb67d6 100644 --- a/test/classes/Gis/GisGeomTestCase.php +++ b/test/classes/Gis/GisGeomTestCase.php @@ -102,7 +102,6 @@ protected static function createEmptyPdf(string $id): TCPDF { $pdf = new TCPDF(); $prop = new ReflectionProperty($pdf, 'file_id'); - $prop->setAccessible(true); $prop->setValue($pdf, md5($id)); $pdf->setDocCreationTimestamp(1600000000); $pdf->setDocModificationTimestamp(1600000000); diff --git a/test/classes/HeaderTest.php b/test/classes/HeaderTest.php index 5a0ad6b2662b..833b85e66794 100644 --- a/test/classes/HeaderTest.php +++ b/test/classes/HeaderTest.php @@ -121,7 +121,6 @@ public function testGetMessage(): void public function testDisableWarnings(): void { $reflection = new ReflectionProperty(Header::class, 'warningsEnabled'); - $reflection->setAccessible(true); $header = new Header(); $header->disableWarnings(); diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index f964442e25d7..6273f9d4a794 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -112,9 +112,7 @@ protected function tearDown(): void { parent::tearDown(); $response = new ReflectionProperty(ResponseRenderer::class, 'instance'); - $response->setAccessible(true); $response->setValue(null); - $response->setAccessible(false); } /** @@ -360,7 +358,6 @@ public function testShowEmptyResultMessageOrSetUniqueCondition(): void $restoreInstance = ResponseRenderer::getInstance(); $response = new ReflectionProperty(ResponseRenderer::class, 'instance'); - $response->setAccessible(true); $response->setValue($responseMock); $result = $this->callFunction( @@ -2971,7 +2968,6 @@ public function testDetermineInsertOrEdit(): void $restoreInstance = ResponseRenderer::getInstance(); $response = new ReflectionProperty(ResponseRenderer::class, 'instance'); - $response->setAccessible(true); $response->setValue($responseMock); $this->insertEdit = new InsertEdit( diff --git a/test/classes/Navigation/Nodes/NodeTest.php b/test/classes/Navigation/Nodes/NodeTest.php index a71a6500a00a..2be84abdb13b 100644 --- a/test/classes/Navigation/Nodes/NodeTest.php +++ b/test/classes/Navigation/Nodes/NodeTest.php @@ -244,7 +244,6 @@ public function testHasSiblingsForNodesAtLevelThree(): void public function testGetWhereClause(): void { $method = new ReflectionMethod(Node::class, 'getWhereClause'); - $method->setAccessible(true); // Vanilla case $node = new Node('default'); diff --git a/test/classes/Plugins/Auth/AuthenticationCookieTest.php b/test/classes/Plugins/Auth/AuthenticationCookieTest.php index 14e17f2cd777..e0c5d57c5bc6 100644 --- a/test/classes/Plugins/Auth/AuthenticationCookieTest.php +++ b/test/classes/Plugins/Auth/AuthenticationCookieTest.php @@ -896,7 +896,6 @@ public function testAuthFailsErrno(): void public function testGetEncryptionSecretEmpty(): void { $method = new ReflectionMethod(AuthenticationCookie::class, 'getEncryptionSecret'); - $method->setAccessible(true); $GLOBALS['cfg']['blowfish_secret'] = ''; $_SESSION['encryption_key'] = ''; @@ -910,7 +909,6 @@ public function testGetEncryptionSecretEmpty(): void public function testGetEncryptionSecretConfigured(): void { $method = new ReflectionMethod(AuthenticationCookie::class, 'getEncryptionSecret'); - $method->setAccessible(true); $key = str_repeat('a', SODIUM_CRYPTO_SECRETBOX_KEYBYTES); $GLOBALS['cfg']['blowfish_secret'] = $key; @@ -924,7 +922,6 @@ public function testGetEncryptionSecretConfigured(): void public function testGetSessionEncryptionSecretConfigured(): void { $method = new ReflectionMethod(AuthenticationCookie::class, 'getEncryptionSecret'); - $method->setAccessible(true); $key = str_repeat('a', SODIUM_CRYPTO_SECRETBOX_KEYBYTES); $GLOBALS['cfg']['blowfish_secret'] = 'blowfish_secret'; diff --git a/test/classes/Plugins/Export/ExportCodegenTest.php b/test/classes/Plugins/Export/ExportCodegenTest.php index f39df3645e71..fc3ddd1b2ace 100644 --- a/test/classes/Plugins/Export/ExportCodegenTest.php +++ b/test/classes/Plugins/Export/ExportCodegenTest.php @@ -57,11 +57,9 @@ protected function tearDown(): void public function testInitSpecificVariables(): void { $method = new ReflectionMethod(ExportCodegen::class, 'init'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrCgFormats = new ReflectionProperty(ExportCodegen::class, 'cgFormats'); - $attrCgFormats->setAccessible(true); $this->assertEquals( [ @@ -75,11 +73,9 @@ public function testInitSpecificVariables(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportCodegen::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportCodegen::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); @@ -246,7 +242,6 @@ public function testCgMakeIdentifier(): void public function testHandleNHibernateCSBody(): void { $method = new ReflectionMethod(ExportCodegen::class, 'handleNHibernateCSBody'); - $method->setAccessible(true); $result = $method->invoke($this->object, 'test_db', 'test_table'); $this->assertEquals( @@ -299,7 +294,6 @@ public function testHandleNHibernateCSBody(): void public function testHandleNHibernateXMLBody(): void { $method = new ReflectionMethod(ExportCodegen::class, 'handleNHibernateXMLBody'); - $method->setAccessible(true); $result = $method->invoke($this->object, 'test_db', 'test_table'); $this->assertEquals( @@ -334,9 +328,6 @@ public function testSetGetCgFormats(): void $getter = $reflection->getMethod('getCgFormats'); $setter = $reflection->getMethod('setCgFormats'); - $getter->setAccessible(true); - $setter->setAccessible(true); - $setter->invoke($this->object, [1, 2]); $this->assertEquals( diff --git a/test/classes/Plugins/Export/ExportCsvTest.php b/test/classes/Plugins/Export/ExportCsvTest.php index 01ce36dd31ec..88a80d17836b 100644 --- a/test/classes/Plugins/Export/ExportCsvTest.php +++ b/test/classes/Plugins/Export/ExportCsvTest.php @@ -67,11 +67,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportCsv::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportCsv::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportExcelTest.php b/test/classes/Plugins/Export/ExportExcelTest.php index 514cb399ecea..9c0c30ecf3b2 100644 --- a/test/classes/Plugins/Export/ExportExcelTest.php +++ b/test/classes/Plugins/Export/ExportExcelTest.php @@ -57,11 +57,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportExcel::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportExcel::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportHtmlwordTest.php b/test/classes/Plugins/Export/ExportHtmlwordTest.php index aad4b8273bfc..8bd6ea75ba6b 100644 --- a/test/classes/Plugins/Export/ExportHtmlwordTest.php +++ b/test/classes/Plugins/Export/ExportHtmlwordTest.php @@ -82,11 +82,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportHtmlword::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportHtmlword::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); @@ -621,7 +619,6 @@ public function testGetTriggers(): void $GLOBALS['dbi'] = $dbi; $method = new ReflectionMethod(ExportHtmlword::class, 'getTriggers'); - $method->setAccessible(true); $result = $method->invoke($this->object, 'database', 'table'); $this->assertStringContainsString( @@ -744,7 +741,6 @@ public function testExportStructure(): void public function testFormatOneColumnDefinition(): void { $method = new ReflectionMethod(ExportHtmlword::class, 'formatOneColumnDefinition'); - $method->setAccessible(true); $cols = [ 'Null' => 'Yes', diff --git a/test/classes/Plugins/Export/ExportJsonTest.php b/test/classes/Plugins/Export/ExportJsonTest.php index 6dfc441c47cb..9ce16432324b 100644 --- a/test/classes/Plugins/Export/ExportJsonTest.php +++ b/test/classes/Plugins/Export/ExportJsonTest.php @@ -60,11 +60,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportJson::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportJson::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportLatexTest.php b/test/classes/Plugins/Export/ExportLatexTest.php index 328a680fae2a..c97593d038f5 100644 --- a/test/classes/Plugins/Export/ExportLatexTest.php +++ b/test/classes/Plugins/Export/ExportLatexTest.php @@ -83,7 +83,6 @@ public function testSetProperties(): void $_SESSION = ['relation' => [$GLOBALS['server'] => $relationParameters->toArray()]]; $method = new ReflectionMethod(ExportLatex::class, 'setProperties'); - $method->setAccessible(true); $properties = $method->invoke($this->object, null); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportMediawikiTest.php b/test/classes/Plugins/Export/ExportMediawikiTest.php index 61d3d8e66258..8bd5fa248e91 100644 --- a/test/classes/Plugins/Export/ExportMediawikiTest.php +++ b/test/classes/Plugins/Export/ExportMediawikiTest.php @@ -70,11 +70,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportMediawiki::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportMediawiki::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportOdsTest.php b/test/classes/Plugins/Export/ExportOdsTest.php index ef581492e8bf..e76170b611ca 100644 --- a/test/classes/Plugins/Export/ExportOdsTest.php +++ b/test/classes/Plugins/Export/ExportOdsTest.php @@ -75,11 +75,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportOds::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportOds::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportOdtTest.php b/test/classes/Plugins/Export/ExportOdtTest.php index 28fb17771934..30b286bee43a 100644 --- a/test/classes/Plugins/Export/ExportOdtTest.php +++ b/test/classes/Plugins/Export/ExportOdtTest.php @@ -99,7 +99,6 @@ public function testSetProperties(): void $_SESSION = ['relation' => [$GLOBALS['server'] => $relationParameters->toArray()]]; $method = new ReflectionMethod(ExportOdt::class, 'setProperties'); - $method->setAccessible(true); $properties = $method->invoke($this->object, null); $this->assertInstanceOf(ExportPluginProperties::class, $properties); @@ -777,7 +776,6 @@ public function testGetTriggers(): void $GLOBALS['dbi'] = $dbi; $method = new ReflectionMethod(ExportOdt::class, 'getTriggers'); - $method->setAccessible(true); $result = $method->invoke($this->object, 'database', 'taassertSame($result, $GLOBALS['odt_buffer']); @@ -952,7 +950,6 @@ public function testExportStructure(): void public function testFormatOneColumnDefinition(): void { $method = new ReflectionMethod(ExportOdt::class, 'formatOneColumnDefinition'); - $method->setAccessible(true); $cols = [ 'Null' => 'Yes', diff --git a/test/classes/Plugins/Export/ExportPdfTest.php b/test/classes/Plugins/Export/ExportPdfTest.php index 9b15b3c1422f..9f2ccfe2ad5a 100644 --- a/test/classes/Plugins/Export/ExportPdfTest.php +++ b/test/classes/Plugins/Export/ExportPdfTest.php @@ -62,11 +62,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportPdf::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportPdf::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); @@ -174,7 +172,6 @@ public function testExportHeader(): void ->method('setTopMargin'); $attrPdf = new ReflectionProperty(ExportPdf::class, 'pdf'); - $attrPdf->setAccessible(true); $attrPdf->setValue($this->object, $pdf); $this->assertTrue( @@ -193,7 +190,6 @@ public function testExportFooter(): void ->willReturn(''); $attrPdf = new ReflectionProperty(ExportPdf::class, 'pdf'); - $attrPdf->setAccessible(true); $attrPdf->setValue($this->object, $pdf); $this->assertTrue( @@ -233,7 +229,6 @@ public function testExportData(): void ->with('SELECT'); $attrPdf = new ReflectionProperty(ExportPdf::class, 'pdf'); - $attrPdf->setAccessible(true); $attrPdf->setValue($this->object, $pdf); $this->assertTrue( @@ -254,11 +249,9 @@ public function testExportData(): void public function testSetGetPdf(): void { $setter = new ReflectionMethod(ExportPdf::class, 'setPdf'); - $setter->setAccessible(true); $setter->invoke($this->object, new Pdf()); $getter = new ReflectionMethod(ExportPdf::class, 'getPdf'); - $getter->setAccessible(true); $this->assertInstanceOf( Pdf::class, $getter->invoke($this->object) diff --git a/test/classes/Plugins/Export/ExportPhparrayTest.php b/test/classes/Plugins/Export/ExportPhparrayTest.php index e76f68a455ee..0eb43095a87b 100644 --- a/test/classes/Plugins/Export/ExportPhparrayTest.php +++ b/test/classes/Plugins/Export/ExportPhparrayTest.php @@ -66,11 +66,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportPhparray::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportPhparray::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportSqlTest.php b/test/classes/Plugins/Export/ExportSqlTest.php index 8f459d48e29c..6836b3631923 100644 --- a/test/classes/Plugins/Export/ExportSqlTest.php +++ b/test/classes/Plugins/Export/ExportSqlTest.php @@ -100,7 +100,6 @@ public function testSetPropertiesWithHideSql(): void $GLOBALS['plugin_param']['single_table'] = false; $method = new ReflectionMethod(ExportSql::class, 'setProperties'); - $method->setAccessible(true); $properties = $method->invoke($this->object, null); $this->assertInstanceOf(ExportPluginProperties::class, $properties); @@ -139,7 +138,6 @@ public function testSetProperties(): void $_SESSION = ['relation' => [$GLOBALS['server'] => $relationParameters->toArray()]]; $method = new ReflectionMethod(ExportSql::class, 'setProperties'); - $method->setAccessible(true); $properties = $method->invoke($this->object, null); $this->assertInstanceOf(ExportPluginProperties::class, $properties); @@ -305,7 +303,6 @@ public function testExportRoutines(): void public function testExportComment(): void { $method = new ReflectionMethod(ExportSql::class, 'exportComment'); - $method->setAccessible(true); $GLOBALS['sql_include_comments'] = true; @@ -337,7 +334,6 @@ public function testExportComment(): void public function testPossibleCRLF(): void { $method = new ReflectionMethod(ExportSql::class, 'possibleCRLF'); - $method->setAccessible(true); $GLOBALS['sql_include_comments'] = true; @@ -693,7 +689,6 @@ public function testGetTableDefForView(): void $GLOBALS['sql_compatibility'] = 'MSSQL'; $method = new ReflectionMethod(ExportSql::class, 'getTableDefForView'); - $method->setAccessible(true); $result = $method->invoke($this->object, 'db', 'view'); $this->assertEquals( @@ -989,7 +984,6 @@ public function testGetTableComments(): void $this->object->relation = new Relation($dbi); $method = new ReflectionMethod(ExportSql::class, 'getTableComments'); - $method->setAccessible(true); $result = $method->invoke($this->object, 'db', '', true, true); $this->assertStringContainsString( @@ -1443,7 +1437,6 @@ public function testMakeCreateTableMSSQLCompatible(): void . " \" double NOT NULL DEFAULT '213'\n"; $method = new ReflectionMethod(ExportSql::class, 'makeCreateTableMSSQLCompatible'); - $method->setAccessible(true); $result = $method->invoke($this->object, $query); $this->assertEquals( diff --git a/test/classes/Plugins/Export/ExportTexytextTest.php b/test/classes/Plugins/Export/ExportTexytextTest.php index 60949befdaa3..1857999fb192 100644 --- a/test/classes/Plugins/Export/ExportTexytextTest.php +++ b/test/classes/Plugins/Export/ExportTexytextTest.php @@ -82,11 +82,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportTexytext::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportTexytext::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportXmlTest.php b/test/classes/Plugins/Export/ExportXmlTest.php index 13f582e9ece7..4f14684a2964 100644 --- a/test/classes/Plugins/Export/ExportXmlTest.php +++ b/test/classes/Plugins/Export/ExportXmlTest.php @@ -71,11 +71,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportXml::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportXml::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Plugins/Export/ExportYamlTest.php b/test/classes/Plugins/Export/ExportYamlTest.php index f6218e5e6bb2..0a235e60cbf3 100644 --- a/test/classes/Plugins/Export/ExportYamlTest.php +++ b/test/classes/Plugins/Export/ExportYamlTest.php @@ -65,11 +65,9 @@ protected function tearDown(): void public function testSetProperties(): void { $method = new ReflectionMethod(ExportYaml::class, 'setProperties'); - $method->setAccessible(true); $method->invoke($this->object, null); $attrProperties = new ReflectionProperty(ExportYaml::class, 'properties'); - $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object); $this->assertInstanceOf(ExportPluginProperties::class, $properties); diff --git a/test/classes/Properties/Options/OptionsPropertyGroupTest.php b/test/classes/Properties/Options/OptionsPropertyGroupTest.php index 1b97753307d9..8cb001a883ef 100644 --- a/test/classes/Properties/Options/OptionsPropertyGroupTest.php +++ b/test/classes/Properties/Options/OptionsPropertyGroupTest.php @@ -38,7 +38,6 @@ protected function tearDown(): void public function testAddProperty(): void { $properties = new ReflectionProperty(OptionsPropertyGroup::class, 'properties'); - $properties->setAccessible(true); $properties->setValue($this->stub, [1, 2, 3]); @@ -59,7 +58,6 @@ public function testAddProperty(): void public function testRemoveProperty(): void { $properties = new ReflectionProperty(OptionsPropertyGroup::class, 'properties'); - $properties->setAccessible(true); $properties->setValue($this->stub, [1, 2, 'test', 3]); $this->stub->removeProperty('test'); @@ -85,7 +83,6 @@ public function testGetGroup(): void public function testGetProperties(): void { $properties = new ReflectionProperty(OptionsPropertyGroup::class, 'properties'); - $properties->setAccessible(true); $properties->setValue($this->stub, [1, 2, 3]); $this->assertEquals( @@ -101,7 +98,6 @@ public function testGetProperties(): void public function testGetNrOfProperties(): void { $properties = new ReflectionProperty(OptionsPropertyGroup::class, 'properties'); - $properties->setAccessible(true); $properties->setValue($this->stub, [1, 2, 3]); $this->assertEquals( diff --git a/test/classes/ScriptsTest.php b/test/classes/ScriptsTest.php index a8f470e1370d..a2246c62d185 100644 --- a/test/classes/ScriptsTest.php +++ b/test/classes/ScriptsTest.php @@ -106,7 +106,6 @@ public function testGetFiles(): void public function testAddFile(): void { $reflection = new ReflectionProperty(Scripts::class, 'files'); - $reflection->setAccessible(true); // Assert empty _files property of // Scripts @@ -132,7 +131,6 @@ public function testAddFile(): void public function testAddFiles(): void { $reflection = new ReflectionProperty(Scripts::class, 'files'); - $reflection->setAccessible(true); $filenames = [ 'common.js', diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php index 904364fc1652..f94d68fc6f70 100644 --- a/test/classes/Server/PrivilegesTest.php +++ b/test/classes/Server/PrivilegesTest.php @@ -1952,7 +1952,6 @@ public function testGetUserPrivileges(): void new Plugins($this->dbi) ); $method = new ReflectionMethod(Privileges::class, 'getUserPrivileges'); - $method->setAccessible(true); /** @var array|null $actual */ $actual = $method->invokeArgs($serverPrivileges, ['test.user', 'test.host', true]); diff --git a/test/classes/Setup/ConfigGeneratorTest.php b/test/classes/Setup/ConfigGeneratorTest.php index 985feb404d08..63c502cb74c0 100644 --- a/test/classes/Setup/ConfigGeneratorTest.php +++ b/test/classes/Setup/ConfigGeneratorTest.php @@ -80,7 +80,6 @@ public function testGetVarExport(): void { $reflection = new ReflectionClass(ConfigGenerator::class); $method = $reflection->getMethod('getVarExport'); - $method->setAccessible(true); $this->assertEquals( '$cfg[\'var_name\'] = 1;' . "\n", @@ -126,7 +125,6 @@ public function testGetVarExportForBlowfishSecret(): void { $reflection = new ReflectionClass(ConfigGenerator::class); $method = $reflection->getMethod('getVarExport'); - $method->setAccessible(true); $this->assertEquals( '$cfg[\'blowfish_secret\'] = \sodium_hex2bin(\'' @@ -152,7 +150,6 @@ public function testIsZeroBasedArray(): void { $reflection = new ReflectionClass(ConfigGenerator::class); $method = $reflection->getMethod('isZeroBasedArray'); - $method->setAccessible(true); $this->assertFalse( $method->invoke( @@ -201,7 +198,6 @@ public function testExportZeroBasedArray(): void { $reflection = new ReflectionClass(ConfigGenerator::class); $method = $reflection->getMethod('exportZeroBasedArray'); - $method->setAccessible(true); $arr = [ 1, diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php index fc45a4d83cf2..4d4a6663f4d7 100644 --- a/test/classes/TrackerTest.php +++ b/test/classes/TrackerTest.php @@ -365,7 +365,6 @@ public function testChangeTracking( if ($type === null) { $method = new ReflectionMethod(Tracker::class, 'changeTracking'); - $method->setAccessible(true); $method->invoke(null, $dbname, $tablename, $version, $new_state); } elseif ($type === 'activate') { Tracker::activateTracking($dbname, $tablename, $version);