mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 10:20:14 +02:00
Fix DyanmoDbHandler test suite
This commit is contained in:
@@ -52,13 +52,20 @@ class DynamoDbHandlerTest extends TestCase
|
|||||||
$handler = new DynamoDbHandler($this->client, 'foo');
|
$handler = new DynamoDbHandler($this->client, 'foo');
|
||||||
$handler->setFormatter($formatter);
|
$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
|
$formatter
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('format')
|
->method('format')
|
||||||
->with($record)
|
->with($record)
|
||||||
->will($this->returnValue($formatted));
|
->will($this->returnValue($formatted));
|
||||||
$this->client
|
$this->client
|
||||||
->expects($this->once())
|
->expects($isV3 ? $this->never() : $this->once())
|
||||||
->method('formatAttributes')
|
->method('formatAttributes')
|
||||||
->with($this->isType('array'))
|
->with($this->isType('array'))
|
||||||
->will($this->returnValue($formatted));
|
->will($this->returnValue($formatted));
|
||||||
@@ -67,7 +74,7 @@ class DynamoDbHandlerTest extends TestCase
|
|||||||
->method('__call')
|
->method('__call')
|
||||||
->with('putItem', array(array(
|
->with('putItem', array(array(
|
||||||
'TableName' => 'foo',
|
'TableName' => 'foo',
|
||||||
'Item' => $formatted,
|
'Item' => $expFormatted,
|
||||||
)));
|
)));
|
||||||
|
|
||||||
$handler->handle($record);
|
$handler->handle($record);
|
||||||
|
Reference in New Issue
Block a user