public function traceMethod($stack = false) { $stack = $stack ? $stack : $this->captureTrace(); foreach ($stack as $frame) { if ($this->frameLiesWithinSimpleTestFolder($frame)) { continue; } if ($this->frameMatchesPrefix($frame)) { return ' at [' . $frame['file'] . ' line ' . $frame['line'] . ']'; } } return ''; }
/** * Uses a stack trace to find the line of an assertion. * @access public * @static */ function getExpectationLine() { $trace = new SimpleStackTrace(array('expect')); return $trace->traceMethod(); }