diff --git a/composer.json b/composer.json index f944c89c..41d2ba36 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.3", "silverstripe/framework": "^6", "silverstripe/cms": "^6", "silverstripe/versioned": "^3" diff --git a/tests/php/Tasks/LinkFieldMigrationTaskTest.php b/tests/php/Tasks/LinkFieldMigrationTaskTest.php index b03e5edc..6fdda841 100644 --- a/tests/php/Tasks/LinkFieldMigrationTaskTest.php +++ b/tests/php/Tasks/LinkFieldMigrationTaskTest.php @@ -3,8 +3,8 @@ namespace SilverStripe\LinkField\Tests\Tasks; use LogicException; +use ReflectionClass; use ReflectionMethod; -use ReflectionProperty; use RuntimeException; use SilverStripe\Core\Convert; use SilverStripe\Core\Environment; @@ -1015,9 +1015,8 @@ public function testCheckForBrokenLinks(bool $hasBrokenLinks): void public function testCheckForBrokenLinksWithHtmlOutput(bool $hasBrokenLinks): void { // Make sure we get HTML output - $reflectionCli = new ReflectionProperty(Environment::class, 'isCliOverride'); - $reflectionCli->setAccessible(true); - $reflectionCli->setValue(false); + $reflectionEnvironment = new ReflectionClass(Environment::class); + $reflectionEnvironment->setStaticPropertyValue('isCliOverride', false); try { $brokenLinkFixtures = $this->getBrokenLinkFixtures($hasBrokenLinks); $this->startCapturingOutput(); @@ -1062,7 +1061,7 @@ public function testCheckForBrokenLinksWithHtmlOutput(bool $hasBrokenLinks): voi } } finally { // Make sure we unset the CLI override - $reflectionCli->setValue(null); + $reflectionEnvironment->setStaticPropertyValue('isCliOverride', null); } }