Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4bdb35

Browse files
committed
fix test report (backtrace index)
1 parent 1cd7baa commit d4bdb35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ protected function assertTrue($bool) {
1616
$bt = debug_backtrace(false);
1717
$count = count($bt);
1818
self::$errors []= sprintf("Assertion failed: %s:%d (%s)\n",
19-
$bt[$count - 2]["file"], $bt[$count - 3]["line"], $bt[$count - 1]["function"]);
19+
$bt[0]["file"], $bt[0]["line"], $bt[1]["function"]);
2020
}
2121

2222
protected function assertEquals($a, $b) {
@@ -27,7 +27,7 @@ protected function assertEquals($a, $b) {
2727
$count = count($bt);
2828
self::$errors []= sprintf("Assertion failed (%s !== %s): %s:%d (%s)\n",
2929
print_r($a, true), print_r($b, true),
30-
$bt[$count - 2]["file"], $bt[$count - 3]["line"], $bt[$count - 1]["function"]);
30+
$bt[0]["file"], $bt[0]["line"], $bt[1]["function"]);
3131
}
3232

3333
public static function run($className) {

0 commit comments

Comments
 (0)