|
4081 - trunk/EventLog/tests/writers [eZComponents: Trunk]: msg#00254web.ezcomponents.cvs
Author: Alexandru Stanoi Date: 2006-11-27 14:14:42 +0100 (Mon, 27 Nov 2006) New Revision: 4081 Log: - Added a test for the fix for bug #9603, but commented out because warnings are thrown. Modified: trunk/EventLog/tests/writers/writer_file_test.php Modified: trunk/EventLog/tests/writers/writer_file_test.php =================================================================== --- trunk/EventLog/tests/writers/writer_file_test.php 2006-11-27 13:09:47 UTC (rev 4080) +++ trunk/EventLog/tests/writers/writer_file_test.php 2006-11-27 13:14:42 UTC (rev 4081) @@ -18,6 +18,25 @@ $this->removeTempDir(); } +/* + // This test was used to check for bug #9603, and it is commented out because + // the code throws warnings for fwrite() and fclose() + public function testWriteNotDefault() + { + $log = ezcLog::getInstance(); + $writer = new TempImplementation2($this->getTempDir(), 'broken.log'); + try + { + $writer->writeLogMessage( 'xxx', 'c', 'd', '' ); + //$log->log( null, ezcLog::INFO, array() ); + $this->fail( 'Expected exception was not thrown' ); + } + catch ( ezcLogWriterException $e ) + { + } + } +*/ + // Check if can be written to the temporary file. public function testSelf() { @@ -208,7 +227,24 @@ $this->write( $type, $source, $category, $res ); } } - +class TempImplementation2 extends ezcLogFileWriter +{ + public function __construct($dir, $file = null, $maxSize = 1, $maxFiles = 1 ) + { + parent::__construct($dir, $file, $maxSize, $maxFiles); + // close the open files in order to see if an exception is thrown + foreach ( $this->openFiles as $fh ) + { + fclose( $fh ); + } + } + public function writeLogMessage( $message, $type, $source, $category, $extraInfo = array() ) + { + $res = print_r( array( "message" => $message, "type" => $type, "source" => $source, "category" => $category ), true ); + $this->write( $type, $source, $category, $res ); + } +} + ?> |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | 4083 - in trunk/Template/tests: . scripts [eZComponents: Trunk]: 00254, Jan Borsodi |
|---|---|
| Next by Date: | 4084 - scripts [eZComponents: Scripts]: 00254, Derick Rethans |
| Previous by Thread: | 4083 - in trunk/Template/tests: . scripts [eZComponents: Trunk]i: 00254, Jan Borsodi |
| Next by Thread: | 4084 - scripts [eZComponents: Scripts]: 00254, Derick Rethans |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |