Navigation Menu

Skip to content

Commit

Permalink
Adding test case for CakeLog stream autoconfiguration.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 4, 2009
1 parent 055b5c6 commit ceb7826
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions cake/tests/cases/libs/cake_log.test.php
Expand Up @@ -30,6 +30,26 @@
*/
class CakeLogTest extends CakeTestCase {

/**
* Test that CakeLog autoconfigures itself to use a FileLogger with the LOGS dir.
* When no streams are there.
*
* @return void
**/
function testAutoConfig() {
$streams = CakeLog::streams();
foreach ($streams as $stream) {
CakeLog::removeStream($stream);
}

@unlink(LOGS . 'error.log');
CakeLog::write(LOG_WARNING, 'Test warning');
$this->assertTrue(file_exists(LOGS . 'error.log'));

$result = CakeLog::streams();
$this->assertEqual($result, array('default'));
}

/**
* testLogFileWriting method
*
Expand Down

0 comments on commit ceb7826

Please sign in to comment.