public function testLoggerAdapterFileSettingJsonFormatter()
{
$this->specify("logging in a file does not create the file", function () {
$I = $this->tester;
$fileName = $I->getNewFileName('log', 'log');
$logger = new File($this->logPath . $fileName);
$logger->setFormatter(new Json());
$logger->log('This is a message');
$logger->log("This is an error", Logger::ERROR);
$logger->error("This is another error");
$I->amInPath($this->logPath);
$I->openFile($fileName);
$expected = sprintf('{"type":"DEBUG","message":"This is a message","timestamp":%s}' . PHP_EOL . '{"type":"ERROR","message":"This is an error","timestamp":%s}' . PHP_EOL . '{"type":"ERROR","message":"This is another error","timestamp":%s}', time(), time(), time());
$I->seeInThisFile($expected);
$I->deleteFile($fileName);
});
}