コード例 #1
0
 function fail($message = '')
 {
     PHPUnit_TestCase::fail($message);
     // save in global var that this particular test has failed
     // (but only if not called from subclass objects / multitests)
     if (function_exists('debug_backtrace') && strtolower(get_class($this)) == 'localhosttests') {
         global $failed_tests;
         $trace = debug_backtrace();
         for ($i = 0; $i < count($trace); $i++) {
             if (strpos($trace[$i]['function'], 'test') === 0) {
                 $failed_tests[$trace[$i]['function']] = true;
                 break;
             }
         }
     }
 }