Definition at line 16 of file ElasticaFormatterTest.php.
◆ setUp()
Monolog\Formatter\ElasticaFormatterTest::setUp |
( |
| ) |
|
Definition at line 18 of file ElasticaFormatterTest.php.
20 if (!class_exists(
"Elastica\Document")) {
21 $this->markTestSkipped(
"ruflin/elastica not installed");
◆ testFormat()
Monolog\Formatter\ElasticaFormatterTest::testFormat |
( |
| ) |
|
Monolog::__construct Monologformat Monolog::getDocument
Definition at line 30 of file ElasticaFormatterTest.php.
References $data, $params, array, and Monolog\Logger\ERROR.
35 'level_name' =>
'ERROR',
37 'context' =>
array(
'foo' => 7,
'bar',
'class' =>
new \stdClass),
38 'datetime' =>
new \DateTime(
"@0"),
45 $expected[
'datetime'] =
'1970-01-01T00:00:00.000000+00:00';
46 $expected[
'context'] =
array(
47 'class' =>
'[object] (stdClass: {})',
53 $formatter =
new ElasticaFormatter(
'my_index',
'doc_type');
54 $doc = $formatter->format($msg);
55 $this->assertInstanceOf(
'Elastica\Document', $doc);
59 $this->assertEquals(
'my_index',
$params[
'_index']);
60 $this->assertEquals(
'doc_type',
$params[
'_type']);
63 $data = $doc->getData();
64 foreach (array_keys($expected) as $key) {
65 $this->assertEquals($expected[$key],
$data[$key]);
const ERROR
Runtime errors.
Create styles array
The data for the language used.
◆ testGetters()
Monolog\Formatter\ElasticaFormatterTest::testGetters |
( |
| ) |
|
Monolog::getIndex Monolog::getType
Definition at line 73 of file ElasticaFormatterTest.php.
75 $formatter =
new ElasticaFormatter(
'my_index',
'doc_type');
76 $this->assertEquals(
'my_index', $formatter->getIndex());
77 $this->assertEquals(
'doc_type', $formatter->getType());
The documentation for this class was generated from the following file: