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
@ -21,12 +21,26 @@ abstract class PhpseclibTestCase extends PHPUnit_Framework_TestCase
|
||||
|
||||
if ($value !== $expected)
|
||||
{
|
||||
self::markTestSkipped(sprintf(
|
||||
"Skipping test because mode constant %s is %s instead of %s",
|
||||
$constant,
|
||||
$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",
|
||||
$constant,
|
||||
$value,
|
||||
$expected
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user