Skip to content

Commit

Permalink
fix deprecation note in test
Browse files Browse the repository at this point in the history
  • Loading branch information
sidz committed Oct 15, 2023
1 parent 3b476d7 commit c1e6055
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/phpunit/Resource/Memory/MemoryLimiterEnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,23 @@ public function test_it_does_not_use_the_system_ini_if_phpdbg_is_disabled_and_xd
$this->markTestSkipped('This test requires running without PHPDBG');
}

$skipped = (new ReflectionClass(XdebugHandler::class))->getProperty('skipped');
$skipped->setAccessible(true);
$skipped->setValue('infection-fake');
$reflectionClass = new ReflectionClass(XdebugHandler::class);

if (PHP_VERSION_ID < 80300) {
$reflectionClass->getProperty('skipped')->setValue('infection-fake');
} else {
$reflectionClass->setStaticPropertyValue('skipped', 'infection-fake');
}

try {
$this->assertFalse($this->environment->isUsingSystemIni());
} finally {
// Restore original value
$skipped->setValue(null);
if (PHP_VERSION_ID < 80300) {
$reflectionClass->getProperty('skipped')->setValue(null);
} else {
$reflectionClass->setStaticPropertyValue('skipped', null);
}
}
}

Expand Down

0 comments on commit c1e6055

Please sign in to comment.