From 58b985110c00bc901fc871098d21e0fd062c7984 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Thu, 25 Dec 2014 14:12:24 +0100 Subject: [PATCH] Added test for using a callable in Log::config() --- tests/TestCase/Log/LogTest.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/TestCase/Log/LogTest.php b/tests/TestCase/Log/LogTest.php index 0d780d2257f..5e956e8e2d3 100644 --- a/tests/TestCase/Log/LogTest.php +++ b/tests/TestCase/Log/LogTest.php @@ -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'); @@ -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')); + } + }