mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-30 08:21:05 +02:00
CS fixes & upgrading cs fixer config
This commit is contained in:
@@ -42,7 +42,7 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'extra' => array('ip' => '127.0.0.1'),
|
||||
),
|
||||
'unknown',
|
||||
'error'
|
||||
'error',
|
||||
),
|
||||
$message
|
||||
);
|
||||
@@ -75,7 +75,7 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'extra' => array('ip' => '127.0.0.1'),
|
||||
),
|
||||
'test : 14',
|
||||
'error'
|
||||
'error',
|
||||
),
|
||||
$message
|
||||
);
|
||||
@@ -104,7 +104,7 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'meh',
|
||||
'log',
|
||||
'unknown',
|
||||
'log'
|
||||
'log',
|
||||
),
|
||||
$message
|
||||
);
|
||||
@@ -143,13 +143,13 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'meh',
|
||||
'log',
|
||||
'unknown',
|
||||
'info'
|
||||
'info',
|
||||
),
|
||||
array(
|
||||
'foo',
|
||||
'log2',
|
||||
'unknown',
|
||||
'warn'
|
||||
'warn',
|
||||
),
|
||||
),
|
||||
$formatter->formatBatch($records)
|
||||
|
@@ -108,7 +108,7 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = $formatter->format($record);
|
||||
@@ -145,11 +145,11 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger', 'exception' => array(
|
||||
'class' => '\Exception',
|
||||
'file' => '/some/file/in/dir.php:56',
|
||||
'trace' => array('/some/file/1.php:23', '/some/file/2.php:3')
|
||||
'trace' => array('/some/file/1.php:23', '/some/file/2.php:3'),
|
||||
)),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array(),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = $formatter->format($record);
|
||||
@@ -173,7 +173,7 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = $formatter->format($record);
|
||||
|
@@ -44,7 +44,7 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'baz' => 'qux',
|
||||
'bool' => false,
|
||||
'null' => null,
|
||||
)
|
||||
),
|
||||
));
|
||||
$this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foo {"foo":"bar","baz":"qux","bool":false,"null":null} []'."\n", $message);
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = json_decode($formatter->format($record), true);
|
||||
@@ -116,7 +116,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = json_decode($formatter->format($record), true);
|
||||
@@ -146,7 +146,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = json_decode($formatter->format($record), true);
|
||||
@@ -223,7 +223,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = json_decode($formatter->format($record), true);
|
||||
@@ -252,7 +252,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = json_decode($formatter->format($record), true);
|
||||
@@ -278,7 +278,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'context' => array('from' => 'logger'),
|
||||
'datetime' => new \DateTime("@0"),
|
||||
'extra' => array('key' => 'pair'),
|
||||
'message' => 'log'
|
||||
'message' => 'log',
|
||||
);
|
||||
|
||||
$message = json_decode($formatter->format($record), true);
|
||||
|
@@ -1,5 +1,14 @@
|
||||
<?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;
|
||||
@@ -128,9 +137,9 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'property' => 'anything',
|
||||
'nest3' => array(
|
||||
'nest4' => 'value',
|
||||
'property' => 'nothing'
|
||||
)
|
||||
)
|
||||
'property' => 'nothing',
|
||||
),
|
||||
),
|
||||
),
|
||||
'level' => Logger::WARNING,
|
||||
'level_name' => Logger::getLevelName(Logger::WARNING),
|
||||
@@ -147,7 +156,7 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'nest2' => array(
|
||||
'property' => 'anything',
|
||||
'nest3' => '[...]',
|
||||
)
|
||||
),
|
||||
),
|
||||
$formattedResult['context']
|
||||
);
|
||||
@@ -165,8 +174,8 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'nest4' => array(
|
||||
'property' => 'nothing',
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'level' => Logger::WARNING,
|
||||
'level_name' => Logger::getLevelName(Logger::WARNING),
|
||||
@@ -186,9 +195,9 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'property' => 'anything',
|
||||
'nest4' => array(
|
||||
'property' => 'nothing',
|
||||
)
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
$formattedResult['context']
|
||||
);
|
||||
@@ -205,7 +214,7 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$record = array(
|
||||
'message' => 'some log message',
|
||||
'context' => array(
|
||||
'nest2' => $someObject
|
||||
'nest2' => $someObject,
|
||||
),
|
||||
'level' => Logger::WARNING,
|
||||
'level_name' => Logger::getLevelName(Logger::WARNING),
|
||||
|
@@ -51,7 +51,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'inf' => 'INF',
|
||||
'-inf' => '-INF',
|
||||
'nan' => 'NaN',
|
||||
)
|
||||
),
|
||||
), $formatted);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'message' => $e2->getMessage(),
|
||||
'code' => $e2->getCode(),
|
||||
'file' => $e2->getFile().':'.$e2->getLine(),
|
||||
)
|
||||
),
|
||||
), $formatted);
|
||||
}
|
||||
|
||||
@@ -284,4 +284,4 @@ class TestToStringError
|
||||
{
|
||||
throw new \RuntimeException('Could not convert to string');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,14 @@
|
||||
<?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;
|
||||
|
||||
class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
@@ -44,7 +54,7 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'bam' => array(1, 2, 3),
|
||||
'bat' => array('foo' => 'bar'),
|
||||
'bap' => \DateTime::createFromFormat(\DateTime::ISO8601, '1970-01-01T00:00:00+0000'),
|
||||
'ban' => $exception
|
||||
'ban' => $exception,
|
||||
));
|
||||
|
||||
$this->assertSame(array(
|
||||
@@ -59,8 +69,8 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'message' => $exception->getMessage(),
|
||||
'code' => $exception->getCode(),
|
||||
'file' => $exception->getFile() . ':' . $exception->getLine(),
|
||||
'trace' => $this->buildTrace($exception)
|
||||
))
|
||||
'trace' => $this->buildTrace($exception),
|
||||
)),
|
||||
), $formatted);
|
||||
}
|
||||
|
||||
@@ -68,11 +78,11 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$context = array('file' => 'foo', 'line' => 1);
|
||||
$formatted = $this->formatter->format(array(
|
||||
'context' => $context
|
||||
'context' => $context,
|
||||
));
|
||||
|
||||
$this->assertSame(array(
|
||||
'context' => $this->encodeJson($context)
|
||||
'context' => $this->encodeJson($context),
|
||||
), $formatted);
|
||||
}
|
||||
|
||||
@@ -81,8 +91,8 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$exception = new \Exception('foo');
|
||||
$formatted = $this->formatter->format(array(
|
||||
'context' => array(
|
||||
'exception' => $exception
|
||||
)
|
||||
'exception' => $exception,
|
||||
),
|
||||
));
|
||||
|
||||
$this->assertSame(array(
|
||||
@@ -92,9 +102,9 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
'message' => $exception->getMessage(),
|
||||
'code' => $exception->getCode(),
|
||||
'file' => $exception->getFile() . ':' . $exception->getLine(),
|
||||
'trace' => $this->buildTrace($exception)
|
||||
)
|
||||
))
|
||||
'trace' => $this->buildTrace($exception),
|
||||
),
|
||||
)),
|
||||
), $formatted);
|
||||
}
|
||||
}
|
||||
|
@@ -65,8 +65,8 @@ class AmqpHandlerTest extends TestCase
|
||||
0,
|
||||
array(
|
||||
'delivery_mode' => 2,
|
||||
'Content-type' => 'application/json'
|
||||
)
|
||||
'Content-type' => 'application/json',
|
||||
),
|
||||
);
|
||||
|
||||
$handler->handle($record);
|
||||
@@ -117,8 +117,8 @@ class AmqpHandlerTest extends TestCase
|
||||
null,
|
||||
array(
|
||||
'delivery_mode' => 2,
|
||||
'content_type' => 'application/json'
|
||||
)
|
||||
'content_type' => 'application/json',
|
||||
),
|
||||
);
|
||||
|
||||
$handler->handle($record);
|
||||
|
@@ -41,7 +41,7 @@ class ChromePHPHandlerTest extends TestCase
|
||||
'test',
|
||||
),
|
||||
'request_uri' => '',
|
||||
))))
|
||||
)))),
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $handler->getHeaders());
|
||||
@@ -81,7 +81,7 @@ class ChromePHPHandlerTest extends TestCase
|
||||
),
|
||||
),
|
||||
'request_uri' => '',
|
||||
))))
|
||||
)))),
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $handler->getHeaders());
|
||||
@@ -110,7 +110,7 @@ class ChromePHPHandlerTest extends TestCase
|
||||
'test',
|
||||
),
|
||||
'request_uri' => '',
|
||||
))))
|
||||
)))),
|
||||
);
|
||||
|
||||
$this->assertEquals($expected, $handler2->getHeaders());
|
||||
|
@@ -67,7 +67,7 @@ class DynamoDbHandlerTest extends TestCase
|
||||
->method('__call')
|
||||
->with('putItem', array(array(
|
||||
'TableName' => 'foo',
|
||||
'Item' => $formatted
|
||||
'Item' => $formatted,
|
||||
)));
|
||||
|
||||
$handler->handle($record);
|
||||
|
@@ -174,7 +174,7 @@ class HipChatHandlerTest extends TestCase
|
||||
array(
|
||||
array('level' => Logger::WARNING, 'message' => 'Oh bugger!', 'level_name' => 'warning', 'datetime' => new \DateTime()),
|
||||
array('level' => Logger::NOTICE, 'message' => 'Something noticeable happened.', 'level_name' => 'notice', 'datetime' => new \DateTime()),
|
||||
array('level' => Logger::CRITICAL, 'message' => 'Everything is broken!', 'level_name' => 'critical', 'datetime' => new \DateTime())
|
||||
array('level' => Logger::CRITICAL, 'message' => 'Everything is broken!', 'level_name' => 'critical', 'datetime' => new \DateTime()),
|
||||
),
|
||||
'red',
|
||||
),
|
||||
|
@@ -45,7 +45,7 @@ class LogEntriesHandlerTest extends TestCase
|
||||
$records = array(
|
||||
$this->getRecord(),
|
||||
$this->getRecord(),
|
||||
$this->getRecord()
|
||||
$this->getRecord(),
|
||||
);
|
||||
$this->createHandler();
|
||||
$this->handler->handleBatch($records);
|
||||
|
@@ -71,7 +71,8 @@ class NativeMailerHandlerTest extends TestCase
|
||||
$mailer->setEncoding("utf-8\r\nFrom: faked@attacker.org");
|
||||
}
|
||||
|
||||
public function testSend() {
|
||||
public function testSend()
|
||||
{
|
||||
$to = 'spammer@example.org';
|
||||
$subject = 'dear victim';
|
||||
$from = 'receiver@example.org';
|
||||
|
@@ -27,7 +27,6 @@ use PHPUnit_Framework_MockObject_MockObject;
|
||||
*/
|
||||
class PHPConsoleHandlerTest extends TestCase
|
||||
{
|
||||
|
||||
/** @var Connector|PHPUnit_Framework_MockObject_MockObject */
|
||||
protected $connector;
|
||||
/** @var DebugDispatcher|PHPUnit_Framework_MockObject_MockObject */
|
||||
@@ -103,7 +102,7 @@ class PHPConsoleHandlerTest extends TestCase
|
||||
protected function initLogger($handlerOptions = array(), $level = Logger::DEBUG)
|
||||
{
|
||||
return new Logger('test', array(
|
||||
new PHPConsoleHandler($handlerOptions, $this->connector, $level)
|
||||
new PHPConsoleHandler($handlerOptions, $this->connector, $level),
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -109,7 +109,7 @@ class RavenHandlerTest extends TestCase
|
||||
|
||||
$user = array(
|
||||
'id' => '123',
|
||||
'email' => 'test@test.com'
|
||||
'email' => 'test@test.com',
|
||||
);
|
||||
|
||||
$recordWithContext = $this->getRecord(Logger::INFO, 'test', array('user' => $user));
|
||||
|
@@ -1,5 +1,14 @@
|
||||
<?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\Handler;
|
||||
|
||||
use Monolog\Logger;
|
||||
@@ -63,7 +72,8 @@ class SwiftMailerHandlerTest extends TestCase
|
||||
$handler->handleBatch($records);
|
||||
}
|
||||
|
||||
public function testMessageHaveUniqueId() {
|
||||
public function testMessageHaveUniqueId()
|
||||
{
|
||||
$messageTemplate = \Swift_Message::newInstance();
|
||||
$handler = new SwiftMailerHandler($this->mailer, $messageTemplate);
|
||||
|
||||
|
@@ -30,7 +30,7 @@ class ZendMonitorHandlerTest extends TestCase
|
||||
{
|
||||
$record = $this->getRecord();
|
||||
$formatterResult = array(
|
||||
'message' => $record['message']
|
||||
'message' => $record['message'],
|
||||
);
|
||||
|
||||
$zendMonitor = $this->getMockBuilder('Monolog\Handler\ZendMonitorHandler')
|
||||
|
@@ -493,5 +493,4 @@ class LoggerTest extends \PHPUnit_Framework_TestCase
|
||||
'without microseconds' => array(false, 'assertSame'),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ class PsrLogMessageProcessorTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$message = $proc(array(
|
||||
'message' => '{foo}',
|
||||
'context' => array('foo' => $val)
|
||||
'context' => array('foo' => $val),
|
||||
));
|
||||
$this->assertEquals($expected, $message['message']);
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ class UidProcessorTest extends TestCase
|
||||
$record = $processor($this->getRecord());
|
||||
$this->assertArrayHasKey('uid', $record['extra']);
|
||||
}
|
||||
|
||||
public function testGetUid()
|
||||
{
|
||||
$processor = new UidProcessor(10);
|
||||
|
@@ -39,7 +39,7 @@ class TestCase extends \PHPUnit_Framework_TestCase
|
||||
$this->getRecord(Logger::DEBUG, 'debug message 2'),
|
||||
$this->getRecord(Logger::INFO, 'information'),
|
||||
$this->getRecord(Logger::WARNING, 'warning'),
|
||||
$this->getRecord(Logger::ERROR, 'error')
|
||||
$this->getRecord(Logger::ERROR, 'error'),
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user