mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 10:20:14 +02:00
Added support for Loggly batch uploads
This commit is contained in:
36
tests/Monolog/Formatter/LogglyFormatterTest.php
Normal file
36
tests/Monolog/Formatter/LogglyFormatterTest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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 LogglyFormatterTest extends TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers Monolog\Formatter\LogglyFormatter::formatBatch
|
||||
*/
|
||||
public function testFormatBatch()
|
||||
{
|
||||
$formatter = new LogglyFormatter();
|
||||
$records = $expected = array(
|
||||
$this->getRecord(Logger::WARNING),
|
||||
$this->getRecord(Logger::DEBUG),
|
||||
);
|
||||
array_walk($expected, function(&$value, $key) {
|
||||
$value = json_encode($value);
|
||||
});
|
||||
$this->assertEquals(implode("\n", $expected), $formatter->formatBatch($records));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user