|
@@ -18,20 +18,20 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase
|
|
|
public function testDefFormatWithString()
|
|
public function testDefFormatWithString()
|
|
|
{
|
|
{
|
|
|
$formatter = new LineFormatter(null, 'Y-m-d');
|
|
$formatter = new LineFormatter(null, 'Y-m-d');
|
|
|
- $record = $formatter->format(array(
|
|
|
|
|
|
|
+ $message = $formatter->format(array(
|
|
|
'level_name' => 'WARNING',
|
|
'level_name' => 'WARNING',
|
|
|
'channel' => 'log',
|
|
'channel' => 'log',
|
|
|
'message' => 'foo',
|
|
'message' => 'foo',
|
|
|
'datetime' => new \DateTime,
|
|
'datetime' => new \DateTime,
|
|
|
'extra' => array(),
|
|
'extra' => array(),
|
|
|
));
|
|
));
|
|
|
- $this->assertEquals('['.date('Y-m-d').'] log.WARNING: foo '."\n", $record['message']);
|
|
|
|
|
|
|
+ $this->assertEquals('['.date('Y-m-d').'] log.WARNING: foo '."\n", $message);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testDefFormatWithArray()
|
|
public function testDefFormatWithArray()
|
|
|
{
|
|
{
|
|
|
$formatter = new LineFormatter(null, 'Y-m-d');
|
|
$formatter = new LineFormatter(null, 'Y-m-d');
|
|
|
- $record = $formatter->format(array(
|
|
|
|
|
|
|
+ $message = $formatter->format(array(
|
|
|
'level_name' => 'ERROR',
|
|
'level_name' => 'ERROR',
|
|
|
'channel' => 'meh',
|
|
'channel' => 'meh',
|
|
|
'datetime' => new \DateTime,
|
|
'datetime' => new \DateTime,
|
|
@@ -41,19 +41,19 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase
|
|
|
'baz' => 'qux',
|
|
'baz' => 'qux',
|
|
|
)
|
|
)
|
|
|
));
|
|
));
|
|
|
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: message(foo: bar, baz: qux) '."\n", $record['message']);
|
|
|
|
|
|
|
+ $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: message(foo: bar, baz: qux) '."\n", $message);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function testDefFormatExtras()
|
|
public function testDefFormatExtras()
|
|
|
{
|
|
{
|
|
|
$formatter = new LineFormatter(null, 'Y-m-d');
|
|
$formatter = new LineFormatter(null, 'Y-m-d');
|
|
|
- $record = $formatter->format(array(
|
|
|
|
|
|
|
+ $message = $formatter->format(array(
|
|
|
'level_name' => 'ERROR',
|
|
'level_name' => 'ERROR',
|
|
|
'channel' => 'meh',
|
|
'channel' => 'meh',
|
|
|
'datetime' => new \DateTime,
|
|
'datetime' => new \DateTime,
|
|
|
'extra' => array('ip' => '127.0.0.1'),
|
|
'extra' => array('ip' => '127.0.0.1'),
|
|
|
'message' => 'log',
|
|
'message' => 'log',
|
|
|
));
|
|
));
|
|
|
- $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log extra(ip: 127.0.0.1)'."\n", $record['message']);
|
|
|
|
|
|
|
+ $this->assertEquals('['.date('Y-m-d').'] meh.ERROR: log extra(ip: 127.0.0.1)'."\n", $message);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|