48 {
50 $formatter = $this->getMock('Monolog\Formatter\FormatterInterface');
51 $formatted = array('foo' => 1, 'bar' => 2);
52 $handler = new DynamoDbHandler($this->client, 'foo');
53 $handler->setFormatter($formatter);
54
55 $formatter
56 ->expects($this->once())
57 ->method('format')
58 ->with($record)
59 ->will($this->returnValue($formatted));
60 $this->client
61 ->expects($this->once())
62 ->method('formatAttributes')
63 ->with($this->isType('array'))
64 ->will($this->returnValue($formatted));
65 $this->client
66 ->expects($this->once())
67 ->method('__call')
68 ->with('putItem', array(array(
69 'TableName' => 'foo',
70 'Item' => $formatted,
71 )));
72
73 $handler->handle($record);
74 }
getRecord($level=Logger::WARNING, $message='test', $context=array())