Definition at line 16 of file DynamoDbHandlerTest.php.
◆ setUp()
Monolog\Handler\DynamoDbHandlerTest::setUp |
( |
| ) |
|
Definition at line 20 of file DynamoDbHandlerTest.php.
22 if (!class_exists(
'Aws\DynamoDb\DynamoDbClient')) {
23 $this->markTestSkipped(
'aws/aws-sdk-php not installed');
26 $this->client = $this->getMockBuilder(
'Aws\DynamoDb\DynamoDbClient')
27 ->setMethods(array(
'formatAttributes',
'__call'))
28 ->disableOriginalConstructor()->getMock();
◆ testConstruct()
Monolog\Handler\DynamoDbHandlerTest::testConstruct |
( |
| ) |
|
Definition at line 31 of file DynamoDbHandlerTest.php.
33 $this->assertInstanceOf(
'Monolog\Handler\DynamoDbHandler',
new DynamoDbHandler($this->client,
'foo'));
◆ testGetFormatter()
Monolog\Handler\DynamoDbHandlerTest::testGetFormatter |
( |
| ) |
|
◆ testHandle()
Monolog\Handler\DynamoDbHandlerTest::testHandle |
( |
| ) |
|
Definition at line 47 of file DynamoDbHandlerTest.php.
References $handler, Monolog\TestCase\getRecord(), and Sabre\Event\once().
50 $formatter = $this->getMock(
'Monolog\Formatter\FormatterInterface');
51 $formatted = array(
'foo' => 1,
'bar' => 2);
52 $handler =
new DynamoDbHandler($this->client,
'foo');
55 $isV3 = defined(
'Aws\Sdk::VERSION') && version_compare(\Aws\Sdk::VERSION,
'3.0',
'>=');
57 $expFormatted = array(
'foo' => array(
'N' => 1),
'bar' => array(
'N' => 2));
59 $expFormatted = $formatted;
63 ->expects($this->
once())
66 ->will($this->returnValue($formatted));
68 ->expects($isV3 ? $this->never() : $this->
once())
69 ->method(
'formatAttributes')
70 ->with($this->isType(
'array'))
71 ->will($this->returnValue($formatted));
73 ->expects($this->
once())
75 ->with(
'putItem', array(array(
77 'Item' => $expFormatted,
getRecord($level=Logger::WARNING, $message='test', $context=array())
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
◆ testInterface()
Monolog\Handler\DynamoDbHandlerTest::testInterface |
( |
| ) |
|
Definition at line 36 of file DynamoDbHandlerTest.php.
38 $this->assertInstanceOf(
'Monolog\Handler\HandlerInterface',
new DynamoDbHandler($this->client,
'foo'));
◆ $client
Monolog\Handler\DynamoDbHandlerTest::$client |
|
private |
The documentation for this class was generated from the following file: