1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-01 10:50:21 +02:00

Merge branch '1.x'

This commit is contained in:
Jordi Boggiano
2017-06-19 02:16:33 +02:00
11 changed files with 66 additions and 27 deletions

View File

@@ -53,13 +53,20 @@ class DynamoDbHandlerTest extends TestCase
$handler = new DynamoDbHandler($this->client, 'foo');
$handler->setFormatter($formatter);
$isV3 = defined('Aws\Sdk::VERSION') && version_compare(\Aws\Sdk::VERSION, '3.0', '>=');
if ($isV3) {
$expFormatted = array('foo' => array('N' => 1), 'bar' => array('N' => 2));
} else {
$expFormatted = $formatted;
}
$formatter
->expects($this->once())
->method('format')
->with($record)
->will($this->returnValue($formatted));
$this->client
->expects($this->once())
->expects($isV3 ? $this->never() : $this->once())
->method('formatAttributes')
->with($this->isType('array'))
->will($this->returnValue($formatted));
@@ -68,7 +75,7 @@ class DynamoDbHandlerTest extends TestCase
->method('__call')
->with('putItem', [[
'TableName' => 'foo',
'Item' => $formatted,
'Item' => $expFormatted,
]]);
$handler->handle($record);