From dc2fa954291f8c782ea48ed73ddef8d84c46a17d Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 6 Jun 2016 14:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/thinkphp/library/think/logTest.php | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/thinkphp/library/think/logTest.php b/tests/thinkphp/library/think/logTest.php index 6161f7d5..554cf60d 100644 --- a/tests/thinkphp/library/think/logTest.php +++ b/tests/thinkphp/library/think/logTest.php @@ -20,29 +20,32 @@ use think\Log; class logTest extends \PHPUnit_Framework_TestCase { - public function testRecord(){ + public function testRecord() + { Log::clear(); Log::record('test'); - $this->assertEquals(['log'=>['test'], Log::getLog()); - Log::record('hello','info'); - $this->assertEquals(['log'=>['test'],'info'=>['hello']], Log::getLog()); + $this->assertEquals(['log' => ['test']], Log::getLog()); + Log::record('hello', 'info'); + $this->assertEquals(['log' => ['test'], 'info' => ['hello']], Log::getLog()); Log::clear(); Log::info('test'); - $this->assertEquals(['info'=>['test']], Log::getLog()); + $this->assertEquals(['info' => ['test']], Log::getLog()); } - public function testSave(){ - Log::init(['type'=>'test']); + public function testSave() + { + Log::init(['type' => 'test']); Log::clear(); Log::record('test'); - Log::record([1,2,3]); + Log::record([1, 2, 3]); $this->assertTrue(Log::save()); } - public function testWrite(){ - Log::init(['type'=>'test']); + public function testWrite() + { + Log::init(['type' => 'test']); Log::clear(); - $this->assertTrue(Log::write('hello','info')); - $this->assertTrue(Log::write([1,2,3],'log')); + $this->assertTrue(Log::write('hello', 'info')); + $this->assertTrue(Log::write([1, 2, 3], 'log')); } }