Closed fredemmott closed 5 years ago
Something along these liens in HackTestCLI seems reasonable:
if ($err is ExpectationFailedException) {
$num_failed++;
}
if ($this->verbose) {
$curr = $err;
while ($curr) {
$output .= Str\format(
"%s\n\n@ %s(%d)\n%s",
$curr->getMessage(),
$curr->getFile(),
$curr->getLine(),
$curr->getTraceAsString(),
);
$curr = $curr->getPrevious();
if ($curr !== null) {
$output .= "\n\nPrevious exception:\n\n";
}
}
This matches PHP behavior -
Throwable::getTrace()
and::getTraceAsString()
do not include the active behavior.Instead,
::getFile()
and::getLine()
must be used - and function name is not exposed.