Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding test case for CakeLog stream autoconfiguration.

  • Loading branch information...
commit ceb7826db09287f44be849438dfb2aef0d071825 1 parent 055b5c6
@markstory markstory authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 cake/tests/cases/libs/cake_log.test.php
View
20 cake/tests/cases/libs/cake_log.test.php
@@ -31,6 +31,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
*
* @access public
Please sign in to comment.
Something went wrong with that request. Please try again.