mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修正
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user