| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Tests\Logger\Monolog; |
| 4 |
|
| 5 |
use MediaWiki\Logger\Monolog\CeeFormatter; |
| 6 |
use MediaWiki\Logger\Monolog\LogstashFormatter; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class CeeFormatterTest extends \MediaWikiUnitTestCase { |
| 12 |
public function testV1() { |
| 13 |
$ls_formatter = new LogstashFormatter( 'app', 'system', '', 'ctx_' ); |
| 14 |
$cee_formatter = new CeeFormatter( 'app', 'system', '', 'ctx_' ); |
| 15 |
$record = [ |
| 16 |
'extra' => [ 'url' => 1 ], |
| 17 |
'context' => [ 'url' => 2 ], |
| 18 |
|
| 19 |
'datetime' => '2020-01-01T00:00:00+00:00' |
| 20 |
]; |
| 21 |
|
| 22 |
$this->assertSame( |
| 23 |
$cee_formatter->format( $record ), |
| 24 |
"@cee: " . $ls_formatter->format( $record ) |
| 25 |
); |
| 26 |
} |
| 27 |
} |