summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-02-05 21:39:52 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-02-05 21:39:52 +0100
commit5f0f6b7c843596a05fb311e4636959ea71e7aaac (patch)
treef2e480a3d0b6775f0c8c89348882fb30c2bce09d
parenta0b991d7de4bfbcc823c113a8438142827bf7cba (diff)
Improve error line information in Test-More
This finds the last frame before Test-More instead of using the topmost frame. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xapplication/third_party/test-more-php/Test-Simple-OO.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/application/third_party/test-more-php/Test-Simple-OO.php b/application/third_party/test-more-php/Test-Simple-OO.php
index 1d33eff2e..9bbe4aada 100755
--- a/application/third_party/test-more-php/Test-Simple-OO.php
+++ b/application/third_party/test-more-php/Test-Simple-OO.php
@@ -154,10 +154,14 @@ class TestSimple {
} else {
echo $this->LastFail = "not ok $title\n";
- $stack = isset($this->Backtrace) ? $this->Backtrace : debug_backtrace();
- $call = array_pop($stack);
- $file = basename($call['file']);
- $line = $call['line'];
+ $stack = isset($this->Backtrace) ? $this->Backtrace : debug_backtrace();
+ foreach (array_reverse($stack) as $frame) {
+ if (isset($frame["object"]) && $frame["object"] == $this) {
+ $file = $frame["file"];
+ $line = $frame["line"];
+ break;
+ }
+ }
unset($this->Backtrace);
if ($caption) {