fixed deprecation summary and missing error_reporting() in tests

This commit is contained in:
Fabien Potencier 2015-01-08 15:49:11 +01:00
parent 50ed09ed4a
commit 367184a6d7

View File

@ -33,15 +33,15 @@ class DeprecationErrorHandler
return PHPUnit_Util_ErrorHandler::handleError($type, $msg, $file, $line, $context); return PHPUnit_Util_ErrorHandler::handleError($type, $msg, $file, $line, $context);
} }
$trace = debug_backtrace(PHP_VERSION_ID >= 50400 ? DEBUG_BACKTRACE_IGNORE_ARGS : false); $trace = debug_backtrace(PHP_VERSION_ID >= 50400 ? DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT : true);
$i = count($trace); $i = count($trace);
while (isset($trace[--$i]['class']) && ('ReflectionMethod' === $trace[$i]['class'] || 0 === strpos($trace[$i]['class'], 'PHPUnit_'))) { while (isset($trace[--$i]['class']) && ('ReflectionMethod' === $trace[$i]['class'] || 0 === strpos($trace[$i]['class'], 'PHPUnit_'))) {
// No-op // No-op
} }
if (isset($trace[$i]['class'])) { if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) {
$class = $trace[$i]['class']; $class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
$method = $trace[$i]['function']; $method = $trace[$i]['function'];
$type = 0 === strpos($method, 'testLegacy') || 0 === strpos($method, 'provideLegacy') || strpos($class, '\Legacy') ? 'legacy' : 'remaining'; $type = 0 === strpos($method, 'testLegacy') || 0 === strpos($method, 'provideLegacy') || strpos($class, '\Legacy') ? 'legacy' : 'remaining';