traceMethod() public method

Captures a stack trace if none given.
public traceMethod ( array $stack = false ) : string
$stack array List of stack frames.
return string Snippet of test report with line number and file.
Exemplo n.º 1
0
 /**
  *    Uses a stack trace to find the line of an assertion.
  *    @access public
  *    @static
  */
 function getExpectationLine()
 {
     $trace = new SimpleStackTrace(array('expect'));
     return $trace->traceMethod();
 }
Exemplo n.º 2
0
 /**
  *    Uses a stack trace to find the line of an assertion.
  * @return string           Line number of first assert*
  *                             method embedded in format string.
  */
 public function getAssertionLine()
 {
     $trace = new SimpleStackTrace(array('assert', 'expect', 'pass', 'fail', 'skip'));
     return $trace->traceMethod();
 }
Exemplo n.º 3
0
 /**
  *    Uses a stack trace to find the line of an assertion.
  *    @return string           Line number of first assert*
  *                             method embedded in format string.
  *    @access public
  */
 function getAssertionLine()
 {
     $trace = new SimpleStackTrace(array('assert', 'click', 'pass', 'fail'));
     return $trace->traceMethod();
 }
Exemplo n.º 4
0
 function testCanFindAssertInTrace()
 {
     $trace = new SimpleStackTrace(array('assert'));
     $this->assertEqual($trace->traceMethod(array(array('file' => '/my_test.php', 'line' => 24, 'function' => 'assertSomething'))), ' at [/my_test.php line 24]');
 }