cvs: pear /PHPUnit/Extensions/Logger Log.php
| From: | Sebastian Bergmann | Date: | Sun, 04 Jan 2004 11:15:21 +0000 |
| Subject: | cvs: pear /PHPUnit/Extensions/Logger Log.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-15337@lists.php.net to get a copy of this message | ||
sebastian Sun Jan 4 06:15:21 2004 EDT
Modified files:
/pear/PHPUnit/Extensions/Logger Log.php
Log:
Untested implementation of PEAR_Log logging.
Index: pear/PHPUnit/Extensions/Logger/Log.php
diff -u pear/PHPUnit/Extensions/Logger/Log.php:1.5 pear/PHPUnit/Extensions/Logger/Log.php:1.6
--- pear/PHPUnit/Extensions/Logger/Log.php:1.5 Thu Jan 1 05:31:41 2004
+++ pear/PHPUnit/Extensions/Logger/Log.php Sun Jan 4 06:15:21 2004
@@ -12,7 +12,7 @@
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
//
-// $Id: Log.php,v 1.5 2004/01/01 10:31:41 sebastian Exp $
+// $Id: Log.php,v 1.6 2004/01/04 11:15:21 sebastian Exp $
//
require_once 'PHPUnit/Framework/TestFailure.php';
@@ -68,6 +68,14 @@
* @access public
*/
public function addError(PHPUnit_Framework_Test $test, Exception $e) {
+ $this->log->crit(
+ sprintf(
+ 'Test "%s" failed: %s',
+
+ $test->getName(),
+ $e->getMessage()
+ )
+ );
}
// }}}
@@ -81,6 +89,14 @@
* @access public
*/
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError
$e) {
+ $this->log->err(
+ sprintf(
+ 'Test "%s" failed: %s',
+
+ $test->getName(),
+ $e->getMessage()
+ )
+ );
}
// }}}
@@ -93,6 +109,13 @@
* @access public
*/
public function endTest(PHPUnit_Framework_Test $test) {
+ $this->log->info(
+ sprintf(
+ 'Test "%s" ended.',
+
+ $test->getName()
+ )
+ );
}
// }}}
@@ -105,6 +128,13 @@
* @access public
*/
public function startTest(PHPUnit_Framework_Test $test) {
+ $this->log->info(
+ sprintf(
+ 'Test "%s" started.',
+
+ $test->getName()
+ )
+ );
}
// }}}