diff options
author | Jordi Boggiano <j.boggiano@seld.be> | 2017-06-19 02:06:55 +0200 |
---|---|---|
committer | Jordi Boggiano <j.boggiano@seld.be> | 2017-06-19 02:06:55 +0200 |
commit | 188a46836b70ed65c2080e828230eff1c5d1b118 (patch) | |
tree | 2dce0b24305bd978b8a4095cd06a9623d14d14f4 | |
parent | 2ea3d95ca22e6feb89a77da30b94781ece723c00 (diff) | |
download | monolog-188a46836b70ed65c2080e828230eff1c5d1b118.zip monolog-188a46836b70ed65c2080e828230eff1c5d1b118.tar.gz monolog-188a46836b70ed65c2080e828230eff1c5d1b118.tar.bz2 |
Fix DyanmoDbHandler test suite
-rw-r--r-- | tests/Monolog/Handler/DynamoDbHandlerTest.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/Monolog/Handler/DynamoDbHandlerTest.php b/tests/Monolog/Handler/DynamoDbHandlerTest.php index f3a6968..2e6c348 100644 --- a/tests/Monolog/Handler/DynamoDbHandlerTest.php +++ b/tests/Monolog/Handler/DynamoDbHandlerTest.php @@ -52,13 +52,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)); @@ -67,7 +74,7 @@ class DynamoDbHandlerTest extends TestCase ->method('__call') ->with('putItem', array(array( 'TableName' => 'foo', - 'Item' => $formatted, + 'Item' => $expFormatted, ))); $handler->handle($record); |