1 backdrop_web_test_case.php protected BackdropTestCase::getAssertionCall()

Cycles through backtrace until the first non-assertion method is found.

Return value

Array representing the true caller.:

File

core/modules/simpletest/backdrop_web_test_case.php, line 334

Class

BackdropTestCase
Base class for Backdrop tests.

Code

protected function getAssertionCall() {
  $backtrace = debug_backtrace();

  // The first element is the call. The second element is the caller.
  // We skip calls that occurred in one of the methods of our base classes
  // or in an assertion function.
  while (($caller = $backtrace[1]) && 
    ((isset($caller['class']) && isset($this->skipClasses[$caller['class']])) ||
      substr($caller['function'], 0, 6) == 'assert')) {
    // We remove that call.
    array_shift($backtrace);
  }

  return _backdrop_get_last_caller($backtrace);
}