Example #1
0
 /**
  *    Extracts the last assertion that was not within
  *    Simpletest itself. The name must start with "assert".
  *    @param array $stack      List of stack frames.
  *    @access public
  *    @static
  */
 function getFormattedAssertionLine($stack)
 {
     foreach ($stack as $frame) {
         if (isset($frame['file'])) {
             if (strpos($frame['file'], SIMPLE_TEST) !== false) {
                 if (dirname($frame['file']) . '/' == SIMPLE_TEST) {
                     continue;
                 }
             }
         }
         if (SimpleDumper::_stackFrameIsAnAssertion($frame)) {
             return ' at [' . $frame['file'] . ' line ' . $frame['line'] . ']';
         }
     }
     return '';
 }