人人商城

testify.report.cli.php 659B

123456789101112131415161718192021222324252627
  1. <?php
  2. require 'helpers.php';
  3. $result = $suiteResults['fail'] === 0 ? 'pass' : 'fail';
  4. echo
  5. str_repeat('-', 80)."\n",
  6. " $title [$result]\n";
  7. foreach($cases as $caseTitle => $case) {
  8. echo
  9. "\n".str_repeat('-', 80)."\n",
  10. "[$result] $caseTitle {pass {$case['pass']} / fail {$case['fail']}}\n\n";
  11. foreach ($case['tests'] as $test) {
  12. echo
  13. "[{$test['result']}] {$test['type']}()\n",
  14. str_repeat(' ', 7)."line {$test['line']}, {$test['file']}\n",
  15. str_repeat(' ', 7)."{$test['source']}\n";
  16. }
  17. }
  18. echo
  19. str_repeat('=', 80)."\n",
  20. "Tests: [$result], {pass {$suiteResults['pass']} / fail {$suiteResults['fail']}}, ",
  21. percent($suiteResults)."% success\n";