Skip to content

Commit

Permalink
Merge pull request #134 from dg/pull-line
Browse files Browse the repository at this point in the history
Dumper::dumpException() writes line of source code
  • Loading branch information
dg committed Feb 7, 2016
2 parents f0bd641 + 5b4abde commit a887016
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Framework/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,10 @@ public static function dumpException($e)
)
: '[internal function]'
)
. $item['class'] . $item['type']
. (isset($item['function']) ? $item['function'] . '()' : '')
. ($item['class'] === 'Tester\Assert' && ($tmp = file($item['file'])) && strpos($tmp[$item['line'] - 1], "::$item[function](")
? trim($tmp[$item['line'] - 1])
: $item['class'] . $item['type'] . $item['function'] . ($item['function'] ? '()' : '')
)
. self::color() . "\n";
}

Expand Down
2 changes: 1 addition & 1 deletion tests/RunnerOutput/JUnitPrinter.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $expected = <<<XML
<testcase classname="RunnerOutput%ds%cases%ds%fail.phptx" name="RunnerOutput%ds%cases%ds%fail.phptx">
<failure message="Failed: STOP
in RunnerOutput%ds%cases%ds%fail.phptx(4) Tester\\Assert::fail()"/>
in RunnerOutput%ds%cases%ds%fail.phptx(4) Tester\\Assert::fail('STOP');"/>
</testcase>
<testcase classname="RunnerOutput%ds%cases%ds%pass.phptx" name="RunnerOutput%ds%cases%ds%pass.phptx"/>
<testcase classname="RunnerOutput%ds%cases%ds%skip.phptx" name="RunnerOutput%ds%cases%ds%skip.phptx">
Expand Down

0 comments on commit a887016

Please sign in to comment.