mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
Fix #18477: Fix detecting availability of Xdebug's stack trace in yii\base\ErrorException
This commit is contained in:
@ -15,10 +15,25 @@ use yiiunit\TestCase;
|
||||
*/
|
||||
class ErrorExceptionTest extends TestCase
|
||||
{
|
||||
public function testXdebugTrace()
|
||||
private function isXdebugStackAvailable()
|
||||
{
|
||||
if (!function_exists('xdebug_get_function_stack')) {
|
||||
$this->markTestSkipped('Xdebug are required.');
|
||||
return false;
|
||||
}
|
||||
$version = phpversion('xdebug');
|
||||
if ($version === false) {
|
||||
return false;
|
||||
}
|
||||
if (version_compare($version, '3.0.0', '<')) {
|
||||
return true;
|
||||
}
|
||||
return false !== strpos(ini_get('xdebug.mode'), 'develop');
|
||||
}
|
||||
|
||||
public function testXdebugTrace()
|
||||
{
|
||||
if (!$this->isXdebugStackAvailable()) {
|
||||
$this->markTestSkipped('Xdebug is required.');
|
||||
}
|
||||
try {
|
||||
throw new ErrorException();
|
||||
|
||||
Reference in New Issue
Block a user