From c238d4d11b7b83420e865f97f9e9641b8613ba8c Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 5 Nov 2009 23:20:40 -0500 Subject: [PATCH] Adding return and test case for CakeLog::write() --- cake/libs/cake_log.php | 2 +- cake/tests/cases/libs/cake_log.test.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cake/libs/cake_log.php b/cake/libs/cake_log.php index 6a4dc7810..f3b0435bc 100644 --- a/cake/libs/cake_log.php +++ b/cake/libs/cake_log.php @@ -12,7 +12,6 @@ * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * - * @filesource * @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org) * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project * @package cake @@ -220,6 +219,7 @@ class CakeLog { $logger =& $self->_streams[$key]; $logger->write($type, $message); } + return true; } /** diff --git a/cake/tests/cases/libs/cake_log.test.php b/cake/tests/cases/libs/cake_log.test.php index a206ada9e..3a5561c2b 100644 --- a/cake/tests/cases/libs/cake_log.test.php +++ b/cake/tests/cases/libs/cake_log.test.php @@ -2,8 +2,6 @@ /** * CakeLogTest file * - * Long description for file - * * PHP versions 4 and 5 * * CakePHP(tm) Tests @@ -131,7 +129,8 @@ class CakeLogTest extends CakeTestCase { */ function testLogFileWriting() { @unlink(LOGS . 'error.log'); - CakeLog::write(LOG_WARNING, 'Test warning'); + $result = CakeLog::write(LOG_WARNING, 'Test warning'); + $this->assertTrue($result); $this->assertTrue(file_exists(LOGS . 'error.log')); unlink(LOGS . 'error.log');