Skip to content

Commit

Permalink
MNT Resolve deprecation warning in test (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Sep 11, 2024
1 parent bccf424 commit 8f02aea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/php/Tasks/LinkFieldMigrationTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace SilverStripe\LinkField\Tests\Tasks;

use LogicException;
use ReflectionClass;
use ReflectionMethod;
use ReflectionProperty;
use RuntimeException;
Expand Down Expand Up @@ -1015,9 +1016,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);
$reflectionCli = new ReflectionClass(Environment::class);
$reflectionCli->setStaticPropertyValue('isCliOverride', false);
try {
$brokenLinkFixtures = $this->getBrokenLinkFixtures($hasBrokenLinks);
$this->startCapturingOutput();
Expand Down Expand Up @@ -1062,7 +1062,7 @@ public function testCheckForBrokenLinksWithHtmlOutput(bool $hasBrokenLinks): voi
}
} finally {
// Make sure we unset the CLI override
$reflectionCli->setValue(null);
$reflectionCli->setStaticPropertyValue('isCliOverride', null);
}
}

Expand Down

0 comments on commit 8f02aea

Please sign in to comment.