Commit 113accb5 authored by Patrick Barroca's avatar Patrick Barroca 🐧

remove xdebug requirement

parent e873ac6f
......@@ -65,8 +65,10 @@ class Storm_Test_ObjectWrapper {
* @return Storm_Test_ObjectWrapper
*/
public static function mock($name = '') {
if (!$name && function_exists('xdebug_call_file') && function_exists('xdebug_call_line'))
$name = 'from '.xdebug_call_file().':'.xdebug_call_line();
if (!$name) {
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$name = 'from ' . $stack[0]['file'] . ':' . $stack[0]['line'];
}
return self::on(new Storm_Test_Mock($name));
}
......
......@@ -31,10 +31,8 @@ trait Storm_Test_THelpers {
public function mock() {
$name = (function_exists('xdebug_call_file') && function_exists('xdebug_call_line'))
? 'from '.xdebug_call_file().':'.xdebug_call_line()
: '';
return Storm_Test_ObjectWrapper::mock($name);
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
return Storm_Test_ObjectWrapper::mock('from ' . $stack[0]['file'] . ':' . $stack[0]['line']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment