1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-18 02:41:24 +02:00

Merge remote-tracking branch 'official/master' into gelf-php-compat

Conflicts:
	composer.json
This commit is contained in:
Benjamin Zikarsky
2014-02-22 16:13:58 +01:00
28 changed files with 234 additions and 121 deletions

View File

@@ -150,6 +150,34 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase
));
$this->assertEquals('['.date('Y-m-d').'] test.CRITICAL: bar [] []'."\n".'['.date('Y-m-d').'] log.WARNING: foo [] []'."\n", $message);
}
public function testFormatShouldStripInlineLineBreaks()
{
$formatter = new LineFormatter(null, 'Y-m-d');
$message = $formatter->format(
array(
'message' => "foo\nbar",
'context' => array(),
'extra' => array(),
)
);
$this->assertRegExp('/foo bar/', $message);
}
public function testFormatShouldNotStripInlineLineBreaksWhenFlagIsSet()
{
$formatter = new LineFormatter(null, 'Y-m-d', true);
$message = $formatter->format(
array(
'message' => "foo\nbar",
'context' => array(),
'extra' => array(),
)
);
$this->assertRegExp('/foo\nbar/', $message);
}
}
class TestFoo

View File

@@ -12,7 +12,6 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
{
$data = array();
$trace = $e->getTrace();
array_shift($trace);
foreach ($trace as $frame) {
if (isset($frame['file'])) {
$data[] = $frame['file'].':'.$frame['line'];