20 if (!class_exists(
'Aws\DynamoDb\DynamoDbClient')) {
21 $this->markTestSkipped(
'aws/aws-sdk-php not installed');
24 $this->client = $this->getMockBuilder(
'Aws\DynamoDb\DynamoDbClient')
25 ->setMethods(array(
'formatAttributes',
'__call'))
26 ->disableOriginalConstructor()->getMock();
31 $this->assertInstanceOf(
'Monolog\Handler\DynamoDbHandler',
new DynamoDbHandler($this->client,
'foo'));
36 $this->assertInstanceOf(
'Monolog\Handler\HandlerInterface',
new DynamoDbHandler($this->client,
'foo'));
42 $this->assertInstanceOf(
'Monolog\Formatter\ScalarFormatter', $handler->getFormatter());
48 $formatter = $this->getMock(
'Monolog\Formatter\FormatterInterface');
49 $formatted = array(
'foo' => 1,
'bar' => 2);
51 $handler->setFormatter($formatter);
54 ->expects($this->once())
57 ->will($this->returnValue($formatted));
59 ->expects($this->once())
60 ->method(
'formatAttributes')
61 ->with($this->isType(
'array'))
62 ->will($this->returnValue($formatted));
64 ->expects($this->once())
66 ->with(
'putItem', array(array(
71 $handler->handle($record);
getRecord($level=Logger::WARNING, $message='test', $context=array())
Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/)