mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 11:39:41 +08:00
Directory creation is moved to export() method
This commit is contained in:
@ -10,6 +10,7 @@ namespace yiiunit\framework\log;
|
||||
use Yii;
|
||||
use yii\helpers\FileHelper;
|
||||
use yii\log\Dispatcher;
|
||||
use yii\log\FileTarget;
|
||||
use yii\log\Logger;
|
||||
use yiiunit\TestCase;
|
||||
|
||||
@ -32,6 +33,22 @@ class FileTargetTest extends TestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function testInit()
|
||||
{
|
||||
$logFile = Yii::getAlias('@yiiunit/runtime/log/filetargettest.log');
|
||||
FileHelper::removeDirectory(dirname($logFile));
|
||||
new FileTarget([
|
||||
'logFile' => Yii::getAlias('@yiiunit/runtime/log/filetargettest.log'),
|
||||
]);
|
||||
$this->assertFileNotExists(
|
||||
dirname($logFile),
|
||||
'Log directory should not be created during init process'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider booleanDataProvider
|
||||
* @param bool $rotateByCopy
|
||||
|
||||
Reference in New Issue
Block a user