Skip to content

Commit c238d4d

Browse files
committed
Adding return and test case for CakeLog::write()
1 parent f414378 commit c238d4d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

cake/libs/cake_log.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* Licensed under The MIT License
1313
* Redistributions of files must retain the above copyright notice.
1414
*
15-
* @filesource
1615
* @copyright Copyright 2005-2009, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
1716
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
1817
* @package cake
@@ -220,6 +219,7 @@ function write($type, $message) {
220219
$logger =& $self->_streams[$key];
221220
$logger->write($type, $message);
222221
}
222+
return true;
223223
}
224224

225225
/**

cake/tests/cases/libs/cake_log.test.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
/**
33
* CakeLogTest file
44
*
5-
* Long description for file
6-
*
75
* PHP versions 4 and 5
86
*
97
* CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
@@ -131,7 +129,8 @@ function testConfig() {
131129
*/
132130
function testLogFileWriting() {
133131
@unlink(LOGS . 'error.log');
134-
CakeLog::write(LOG_WARNING, 'Test warning');
132+
$result = CakeLog::write(LOG_WARNING, 'Test warning');
133+
$this->assertTrue($result);
135134
$this->assertTrue(file_exists(LOGS . 'error.log'));
136135
unlink(LOGS . 'error.log');
137136

0 commit comments

Comments
 (0)