Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Resolve deprecation warning in test #331

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading