home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / Console_TestListener.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  903 b   |  32 lines

  1. <?php
  2. class Console_TestListener extends PHPUnit_TestListener {
  3.     function addError(&$test, &$t) {
  4.         $this->_errors += 1;
  5.         echo(" Error $this->_errors in ".$test->getName()." : $t\n");
  6.     }
  7.  
  8.     function addFailure(&$test, &$t) {
  9.         $this->_fails += 1;
  10.         if ($this->_fails == 1) {
  11.             echo("\n");
  12.         }
  13.         echo("Failure $this->_fails : $t\n");
  14.     }
  15.  
  16.     function endTest(&$test) {
  17.         if ($this->_fails == 0 && $this->_errors == 0) {
  18.             echo(' Test passed');
  19.         } else {
  20.             echo("There were $this->_fails failures for ".$test->getName()."\n");
  21.             echo("There were $this->_errors errors for ".$test->getName()."\n");
  22.         }
  23.         echo("\n");
  24.     }
  25.  
  26.     function startTest(&$test) {
  27.         $this->_fails = 0;
  28.         $this->_errors = 0;
  29.         echo(get_class($test).' : Starting '.$test->getName().' ...');
  30.     }
  31. }
  32. ?>