cvs: pear /PHPUnit2/Framework TestResult.php /PHPUnit2/TextUI TestRunner.php /PHPUnit2/Util Printer.php /PHPUnit2/Util/Log GraphViz.php TAP.php
XML.php /PHPUnit2/Util/TestDox ResultPrinter.php
| From: | Sebastian Bergmann | Date: | Wed, 01 Mar 2006 14:31:42 +0000 |
| Subject: | cvs: pear /PHPUnit2/Framework TestResult.php /PHPUnit2/TextUI TestRunner.php /PHPUnit2/Util Printer.php /PHPUnit2/Util/Log GraphViz.php TAP.php XML.php /PHPUnit2/Util/TestDox ResultPrinter.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38787@lists.php.net to get a copy of this message | ||
sebastian Wed Mar 1 14:31:42 2006 UTC
Modified files:
/pear/PHPUnit2/Framework TestResult.php
/pear/PHPUnit2/TextUI TestRunner.php
/pear/PHPUnit2/Util Printer.php
/pear/PHPUnit2/Util/Log GraphViz.php TAP.php XML.php
/pear/PHPUnit2/Util/TestDox ResultPrinter.php
Log:
Better solution for flushing TestListeners.
http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Framework/TestResult.php?r1=1.47&r2=1.48&diff_format=u Index: pear/PHPUnit2/Framework/TestResult.php diff -u pear/PHPUnit2/Framework/TestResult.php:1.47 pear/PHPUnit2/Framework/TestResult.php:1.48 --- pear/PHPUnit2/Framework/TestResult.php:1.47 Wed Mar 1 13:10:32 2006 +++ pear/PHPUnit2/Framework/TestResult.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestResult.php,v 1.47 2006/03/01 13:10:32 sebastian Exp $ + * @version CVS: $Id: TestResult.php,v 1.48 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -59,6 +59,7 @@ 'PHPUnit2_Framework_TestFailure', 'PHPUnit2_Framework_TestListener', 'PHPUnit2_Framework_TestSuite', + 'PHPUnit2_Util_Printer', 'PHPUnit2_Util_Test', ) ); @@ -168,14 +169,18 @@ } /** - * Unregisters all TestListeners. + * Flushes all flushable TestListeners. * * @access public * @since Method available since Release 3.0.0 */ - public function removeListeners() + public function flushListeners() { - $this->listeners = array(); + foreach ($this->listeners as $listener) { + if ($listener instanceof PHPUnit2_Util_Printer) { + $listener->flush(); + } + } } /** http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/TextUI/TestRunner.php?r1=1.86&r2=1.87&diff_format=u Index: pear/PHPUnit2/TextUI/TestRunner.php diff -u pear/PHPUnit2/TextUI/TestRunner.php:1.86 pear/PHPUnit2/TextUI/TestRunner.php:1.87 --- pear/PHPUnit2/TextUI/TestRunner.php:1.86 Wed Mar 1 13:10:32 2006 +++ pear/PHPUnit2/TextUI/TestRunner.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestRunner.php,v 1.86 2006/03/01 13:10:32 sebastian Exp $ + * @version CVS: $Id: TestRunner.php,v 1.87 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -507,7 +507,7 @@ $suite->run($result); $timeElapsed = PHPUnit2_Util_Timer::stop(); - $result->removeListeners(); + $result->flushListeners(); $this->pause($wait); http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Printer.php?r1=1.17&r2=1.18&diff_format=u Index: pear/PHPUnit2/Util/Printer.php diff -u pear/PHPUnit2/Util/Printer.php:1.17 pear/PHPUnit2/Util/Printer.php:1.18 --- pear/PHPUnit2/Util/Printer.php:1.17 Mon Feb 27 05:47:03 2006 +++ pear/PHPUnit2/Util/Printer.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Printer.php,v 1.17 2006/02/27 05:47:03 sebastian Exp $ + * @version CVS: $Id: Printer.php,v 1.18 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -89,11 +89,11 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { if ($this->out !== NULL) { fclose($this->out); http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Log/GraphViz.php?r1=1.10&r2=1.11&diff_format=u Index: pear/PHPUnit2/Util/Log/GraphViz.php diff -u pear/PHPUnit2/Util/Log/GraphViz.php:1.10 pear/PHPUnit2/Util/Log/GraphViz.php:1.11 --- pear/PHPUnit2/Util/Log/GraphViz.php:1.10 Wed Mar 1 06:33:20 2006 +++ pear/PHPUnit2/Util/Log/GraphViz.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: GraphViz.php,v 1.10 2006/03/01 06:33:20 sebastian Exp $ + * @version CVS: $Id: GraphViz.php,v 1.11 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 3.0.0 */ @@ -138,15 +138,15 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { $this->write($this->graph->parse()); - parent::__destruct(); + parent::flush(); } /** http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Log/TAP.php?r1=1.16&r2=1.17&diff_format=u Index: pear/PHPUnit2/Util/Log/TAP.php diff -u pear/PHPUnit2/Util/Log/TAP.php:1.16 pear/PHPUnit2/Util/Log/TAP.php:1.17 --- pear/PHPUnit2/Util/Log/TAP.php:1.16 Mon Feb 27 05:47:03 2006 +++ pear/PHPUnit2/Util/Log/TAP.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TAP.php,v 1.16 2006/02/27 05:47:03 sebastian Exp $ + * @version CVS: $Id: TAP.php,v 1.17 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 3.0.0 */ @@ -90,11 +90,11 @@ private $testSuccessful = TRUE; /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { $this->write( sprintf( @@ -104,7 +104,7 @@ ) ); - parent::__destruct(); + parent::flush(); } /** http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Log/XML.php?r1=1.11&r2=1.12&diff_format=u Index: pear/PHPUnit2/Util/Log/XML.php diff -u pear/PHPUnit2/Util/Log/XML.php:1.11 pear/PHPUnit2/Util/Log/XML.php:1.12 --- pear/PHPUnit2/Util/Log/XML.php:1.11 Wed Jan 4 07:04:53 2006 +++ pear/PHPUnit2/Util/Log/XML.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: XML.php,v 1.11 2006/01/04 07:04:53 sebastian Exp $ + * @version CVS: $Id: XML.php,v 1.12 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.3.0 */ @@ -155,17 +155,17 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { if ($this->writeDocument === TRUE) { $this->write($this->getXML()); } - parent::__destruct(); + parent::flush(); } /** @@ -361,7 +361,7 @@ /** * Enables or disables the writing of the document - * in __destruct(). + * in flush(). * * This is a "hack" needed for the integration of * PHPUnit with Phing. http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/TestDox/ResultPrinter.php?r1=1.12&r2=1.13&diff_format=u Index: pear/PHPUnit2/Util/TestDox/ResultPrinter.php diff -u pear/PHPUnit2/Util/TestDox/ResultPrinter.php:1.12 pear/PHPUnit2/Util/TestDox/ResultPrinter.php:1.13 --- pear/PHPUnit2/Util/TestDox/ResultPrinter.php:1.12 Wed Jan 4 07:04:53 2006 +++ pear/PHPUnit2/Util/TestDox/ResultPrinter.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ResultPrinter.php,v 1.12 2006/01/04 07:04:53 sebastian Exp $ + * @version CVS: $Id: ResultPrinter.php,v 1.13 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.3.0 */ @@ -116,16 +116,16 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { $this->doEndClass(); $this->endRun(); - parent::__destruct(); + parent::flush(); } /**
http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Framework/TestResult.php?r1=1.47&r2=1.48&diff_format=u Index: pear/PHPUnit2/Framework/TestResult.php diff -u pear/PHPUnit2/Framework/TestResult.php:1.47 pear/PHPUnit2/Framework/TestResult.php:1.48 --- pear/PHPUnit2/Framework/TestResult.php:1.47 Wed Mar 1 13:10:32 2006 +++ pear/PHPUnit2/Framework/TestResult.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestResult.php,v 1.47 2006/03/01 13:10:32 sebastian Exp $ + * @version CVS: $Id: TestResult.php,v 1.48 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -59,6 +59,7 @@ 'PHPUnit2_Framework_TestFailure', 'PHPUnit2_Framework_TestListener', 'PHPUnit2_Framework_TestSuite', + 'PHPUnit2_Util_Printer', 'PHPUnit2_Util_Test', ) ); @@ -168,14 +169,18 @@ } /** - * Unregisters all TestListeners. + * Flushes all flushable TestListeners. * * @access public * @since Method available since Release 3.0.0 */ - public function removeListeners() + public function flushListeners() { - $this->listeners = array(); + foreach ($this->listeners as $listener) { + if ($listener instanceof PHPUnit2_Util_Printer) { + $listener->flush(); + } + } } /** http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/TextUI/TestRunner.php?r1=1.86&r2=1.87&diff_format=u Index: pear/PHPUnit2/TextUI/TestRunner.php diff -u pear/PHPUnit2/TextUI/TestRunner.php:1.86 pear/PHPUnit2/TextUI/TestRunner.php:1.87 --- pear/PHPUnit2/TextUI/TestRunner.php:1.86 Wed Mar 1 13:10:32 2006 +++ pear/PHPUnit2/TextUI/TestRunner.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TestRunner.php,v 1.86 2006/03/01 13:10:32 sebastian Exp $ + * @version CVS: $Id: TestRunner.php,v 1.87 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -507,7 +507,7 @@ $suite->run($result); $timeElapsed = PHPUnit2_Util_Timer::stop(); - $result->removeListeners(); + $result->flushListeners(); $this->pause($wait); http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Printer.php?r1=1.17&r2=1.18&diff_format=u Index: pear/PHPUnit2/Util/Printer.php diff -u pear/PHPUnit2/Util/Printer.php:1.17 pear/PHPUnit2/Util/Printer.php:1.18 --- pear/PHPUnit2/Util/Printer.php:1.17 Mon Feb 27 05:47:03 2006 +++ pear/PHPUnit2/Util/Printer.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: Printer.php,v 1.17 2006/02/27 05:47:03 sebastian Exp $ + * @version CVS: $Id: Printer.php,v 1.18 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -89,11 +89,11 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { if ($this->out !== NULL) { fclose($this->out); http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Log/GraphViz.php?r1=1.10&r2=1.11&diff_format=u Index: pear/PHPUnit2/Util/Log/GraphViz.php diff -u pear/PHPUnit2/Util/Log/GraphViz.php:1.10 pear/PHPUnit2/Util/Log/GraphViz.php:1.11 --- pear/PHPUnit2/Util/Log/GraphViz.php:1.10 Wed Mar 1 06:33:20 2006 +++ pear/PHPUnit2/Util/Log/GraphViz.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: GraphViz.php,v 1.10 2006/03/01 06:33:20 sebastian Exp $ + * @version CVS: $Id: GraphViz.php,v 1.11 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 3.0.0 */ @@ -138,15 +138,15 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { $this->write($this->graph->parse()); - parent::__destruct(); + parent::flush(); } /** http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Log/TAP.php?r1=1.16&r2=1.17&diff_format=u Index: pear/PHPUnit2/Util/Log/TAP.php diff -u pear/PHPUnit2/Util/Log/TAP.php:1.16 pear/PHPUnit2/Util/Log/TAP.php:1.17 --- pear/PHPUnit2/Util/Log/TAP.php:1.16 Mon Feb 27 05:47:03 2006 +++ pear/PHPUnit2/Util/Log/TAP.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: TAP.php,v 1.16 2006/02/27 05:47:03 sebastian Exp $ + * @version CVS: $Id: TAP.php,v 1.17 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 3.0.0 */ @@ -90,11 +90,11 @@ private $testSuccessful = TRUE; /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { $this->write( sprintf( @@ -104,7 +104,7 @@ ) ); - parent::__destruct(); + parent::flush(); } /** http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/Log/XML.php?r1=1.11&r2=1.12&diff_format=u Index: pear/PHPUnit2/Util/Log/XML.php diff -u pear/PHPUnit2/Util/Log/XML.php:1.11 pear/PHPUnit2/Util/Log/XML.php:1.12 --- pear/PHPUnit2/Util/Log/XML.php:1.11 Wed Jan 4 07:04:53 2006 +++ pear/PHPUnit2/Util/Log/XML.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: XML.php,v 1.11 2006/01/04 07:04:53 sebastian Exp $ + * @version CVS: $Id: XML.php,v 1.12 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.3.0 */ @@ -155,17 +155,17 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { if ($this->writeDocument === TRUE) { $this->write($this->getXML()); } - parent::__destruct(); + parent::flush(); } /** @@ -361,7 +361,7 @@ /** * Enables or disables the writing of the document - * in __destruct(). + * in flush(). * * This is a "hack" needed for the integration of * PHPUnit with Phing. http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Util/TestDox/ResultPrinter.php?r1=1.12&r2=1.13&diff_format=u Index: pear/PHPUnit2/Util/TestDox/ResultPrinter.php diff -u pear/PHPUnit2/Util/TestDox/ResultPrinter.php:1.12 pear/PHPUnit2/Util/TestDox/ResultPrinter.php:1.13 --- pear/PHPUnit2/Util/TestDox/ResultPrinter.php:1.12 Wed Jan 4 07:04:53 2006 +++ pear/PHPUnit2/Util/TestDox/ResultPrinter.php Wed Mar 1 14:31:42 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: ResultPrinter.php,v 1.12 2006/01/04 07:04:53 sebastian Exp $ + * @version CVS: $Id: ResultPrinter.php,v 1.13 2006/03/01 14:31:42 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.3.0 */ @@ -116,16 +116,16 @@ } /** - * Destructor. + * Flush buffer and close output. * * @access public */ - public function __destruct() + public function flush() { $this->doEndClass(); $this->endRun(); - parent::__destruct(); + parent::flush(); } /**