Permalink
Browse files

Fix tests

  • Loading branch information...
1 parent 8dd213f commit 0df12342ef6c5efc748b27bb9ef92e1c95631058 @Seldaek committed Dec 14, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 tests/Monolog/Formatter/LogstashFormatterTest.php
@@ -22,7 +22,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
*/
public function testDefaultFormatter()
{
- $formatter = new LogstashFormatter('test');
+ $formatter = new LogstashFormatter('test', 'hostname');
$record = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',
@@ -40,13 +40,14 @@ public function testDefaultFormatter()
$this->assertEquals('meh', $message['@fields']['channel']);
$this->assertContains('meh', $message['@tags']);
$this->assertEquals(Logger::ERROR, $message['@fields']['level']);
- $this->assertEquals('test', $message['@source']);
+ $this->assertEquals('test', $message['@type']);
+ $this->assertEquals('hostname', $message['@source']);
$formatter = new LogstashFormatter('mysystem');
$message = json_decode($formatter->format($record), true);
- $this->assertEquals('mysystem', $message['@source']);
+ $this->assertEquals('mysystem', $message['@type']);
}
/**
@@ -140,7 +141,7 @@ public function testFormatWithExtra()
public function testFormatWithApplicationName()
{
- $formatter = new LogstashFormatter('test', 'app');
+ $formatter = new LogstashFormatter('app', 'test');
$record = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',

0 comments on commit 0df1234

Please sign in to comment.