mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 18:55:13 +00:00
[constant-trickery] Try to use runkit to redefine mode constants.
This commit is contained in:
parent
55e9f4d7ef
commit
306f0711ed
@ -20,6 +20,19 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
|
||||
$value = constant($constant);
|
||||
|
||||
if ($value !== $expected)
|
||||
{
|
||||
if (function_exists('runkit_constant_redefine'))
|
||||
{
|
||||
if (!runkit_constant_redefine($constant, $expected))
|
||||
{
|
||||
self::markTestSkipped(sprintf(
|
||||
"Failed to redefine mode constant %s to %s",
|
||||
$constant,
|
||||
$expected
|
||||
));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self::markTestSkipped(sprintf(
|
||||
"Skipping test because mode constant %s is %s instead of %s",
|
||||
@ -29,6 +42,7 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
define($constant, $expected);
|
||||
|
Loading…
Reference in New Issue
Block a user