1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-02-24 23:12:33 +01:00
php-monolog/tests/Monolog/Formatter/JsonFormatterTest.php
2011-07-20 00:04:49 +02:00

42 lines
1015 B
PHP

<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Logger;
use Monolog\TestCase;
class JsonFormatterTest extends TestCase
{
/**
* @covers Monolog\Formatter\JsonFormatter::format
*/
public function testFormat()
{
$formatter = new JsonFormatter();
$record = $this->getRecord();
$this->assertEquals(json_encode($record), $formatter->format($record));
}
/**
* @covers Monolog\Formatter\JsonFormatter::formatBatch
*/
public function testFormatBatch()
{
$formatter = new JsonFormatter();
$records = array(
$this->getRecord(Logger::WARNING),
$this->getRecord(Logger::DEBUG),
);
$this->assertEquals(json_encode($records), $formatter->formatBatch($records));
}
}