From 69ed9a094c64c25c5c422eee79e9e47945151301 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:15:53 +1200 Subject: [PATCH] DEP Limit PHP support for CMS 6 (#598) --- .github/workflows/ci.yml | 6 +++--- composer.json | 2 +- tests/Schema/IntegrationTest.php | 9 ++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95ecfa2e..ac8d4a1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,15 +11,15 @@ jobs: uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1 with: extra_jobs: | - - php: 8.1 + - php: 8.3 endtoend: true endtoend_suite: asset-admin endtoend_config: vendor/silverstripe/asset-admin/behat.yml - - php: 8.1 + - php: 8.3 endtoend: true endtoend_suite: versioned-admin endtoend_config: vendor/silverstripe/versioned-admin/behat.yml - - php: 8.1 + - php: 8.3 endtoend: true endtoend_suite: silverstripe-elemental endtoend_config: vendor/dnadesign/silverstripe-elemental/behat.yml diff --git a/composer.json b/composer.json index cc516f39..0a8c0e52 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "silverstripe-vendormodule", "license": "BSD-3-Clause", "require": { - "php": "^8.1", + "php": "^8.3", "silverstripe/framework": "^6", "silverstripe/vendor-plugin": "^2", "webonyx/graphql-php": "^15.0.1", diff --git a/tests/Schema/IntegrationTest.php b/tests/Schema/IntegrationTest.php index c563abe4..70a5df58 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(); + $reflectionValidator = new ReflectionClass(DocumentValidator::class); + $rules = $reflectionValidator->getStaticPropertyValue('rules'); unset($rules[$ruleName]); - $reflectionRules->setValue($rules); + $reflectionValidator->setStaticPropertyValue('rules', $rules); } private function createProviderForComplexityOrDepth(int $limit): array