From a508ded2bc28e9de3afb5dbc19354314a8107c0a Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 10 Sep 2024 12:04:08 +1200 Subject: [PATCH] MNT Resolve deprecation warning in test --- tests/Schema/IntegrationTest.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/Schema/IntegrationTest.php b/tests/Schema/IntegrationTest.php index c563abe4..8739567d 100644 --- a/tests/Schema/IntegrationTest.php +++ b/tests/Schema/IntegrationTest.php @@ -43,7 +43,7 @@ use GraphQL\Validator\Rules\QueryComplexity; use GraphQL\Validator\Rules\QueryDepth; use GraphQL\Validator\ValidationContext; -use ReflectionProperty; +use ReflectionClass; class IntegrationTest extends SapphireTest { @@ -1688,11 +1688,10 @@ public function testGlobalRuleNotRemoved() private function removeDocumentValidatorRule(string $ruleName): void { - $reflectionRules = new ReflectionProperty(DocumentValidator::class, 'rules'); - $reflectionRules->setAccessible(true); - $rules = $reflectionRules->getValue(); + $reflectionRules = new ReflectionClass(DocumentValidator::class); + $rules = $reflectionRules->getStaticPropertyValue('rules'); unset($rules[$ruleName]); - $reflectionRules->setValue($rules); + $reflectionRules->setStaticPropertyValue('rules', $rules); } private function createProviderForComplexityOrDepth(int $limit): array