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

Skip to content

Commit 189e280

Browse files
Add an additional test function to test.php
1 parent 110a993 commit 189e280

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/test.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ protected function assertTrue($bool) {
1919
$bt[0]["file"], $bt[0]["line"], $bt[1]["function"]);
2020
}
2121

22+
protected function assertLess($a, $b) {
23+
if($a < $b)
24+
return;
25+
26+
$bt = debug_backtrace(false);
27+
self::$errors[] = sprintf("Assertion failed (%s >= %s): %s: %d (%s\n",
28+
print_r($a, true), print_r($b, true),
29+
$bt[0]["file"], $bt[0]["line"], $bt[1]["function"]);
30+
}
31+
2232
protected function assertEquals($a, $b) {
2333
if($a === $b)
2434
return;
@@ -43,7 +53,6 @@ public static function run($className) {
4353
$methods = $rc->GetMethods(ReflectionMethod::IS_PUBLIC);
4454

4555
foreach($methods as $m) {
46-
4756
$name = $m->name;
4857
if(substr($name, 0, 4) !== 'test')
4958
continue;

0 commit comments

Comments
 (0)