48 {
50 $formatter = $this->getMock('Monolog\Formatter\FormatterInterface');
51 $formatted = array('foo' => 1, 'bar' => 2);
52 $handler =
new DynamoDbHandler($this->client,
'foo');
54
55 $isV3 = defined('Aws\Sdk::VERSION') && version_compare(\Aws\Sdk::VERSION, '3.0', '>=');
56 if ($isV3) {
57 $expFormatted = array('foo' => array('N' => 1), 'bar' => array('N' => 2));
58 } else {
59 $expFormatted = $formatted;
60 }
61
62 $formatter
63 ->expects($this->
once())
64 ->method('format')
65 ->with($record)
66 ->will($this->returnValue($formatted));
67 $this->client
68 ->expects($isV3 ? $this->never() : $this->
once())
69 ->method('formatAttributes')
70 ->with($this->isType('array'))
71 ->will($this->returnValue($formatted));
72 $this->client
73 ->expects($this->
once())
74 ->method('__call')
75 ->with('putItem', array(array(
76 'TableName' => 'foo',
77 'Item' => $expFormatted,
78 )));
79
81 }
getRecord($level=Logger::WARNING, $message='test', $context=array())
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.