Skip to content

Commit

Permalink
Added test for using a callable in Log::config()
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Dec 25, 2014
1 parent 77039a1 commit 58b9851
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/TestCase/Log/LogTest.php
Expand Up @@ -537,7 +537,7 @@ public function testConvenienceMethods() {
/**
* Test that write() returns false on an unhandled message.
*
* @return false
* @return void
*/
public function testWriteUnhandled() {
Log::drop('error');
Expand All @@ -547,4 +547,17 @@ public function testWriteUnhandled() {
$this->assertFalse($result);
}

/**
* Tests using a callable for creating a Log engine
*
* @return void
*/
public function testCreateLoggerWithCallable() {
$instance = new FileLog;
Log::config('default', function () use ($instance) {
return $instance;
});
$this->assertSame($instance, Log::engine('default'));
}

}

0 comments on commit 58b9851

Please sign in to comment.