Skip to content

Commit

Permalink
MNT Resolve deprecation warning in test (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Sep 11, 2024
1 parent 8042cfc commit 4a67d04
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/Schema/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4a67d04

Please sign in to comment.