◆ constructArgumentProvider()
Monolog\Formatter\MongoDBFormatterTest::constructArgumentProvider |
( |
| ) |
|
◆ setUp()
Monolog\Formatter\MongoDBFormatterTest::setUp |
( |
| ) |
|
Definition at line 21 of file MongoDBFormatterTest.php.
23 if (!class_exists(
'MongoDate')) {
24 $this->markTestSkipped(
'mongo extension not installed');
◆ testConstruct()
Monolog\Formatter\MongoDBFormatterTest::testConstruct |
( |
|
$traceDepth, |
|
|
|
$traceAsString, |
|
|
|
$expectedTraceDepth, |
|
|
|
$expectedTraceAsString |
|
) |
| |
- Parameters
-
$traceDepth | |
$traceAsString | |
$expectedTraceDepth | |
$expectedTraceAsString | constructArgumentProvider |
Definition at line 44 of file MongoDBFormatterTest.php.
46 $formatter =
new MongoDBFormatter($traceDepth, $traceAsString);
48 $reflTrace = new \ReflectionProperty($formatter,
'exceptionTraceAsString');
49 $reflTrace->setAccessible(
true);
50 $this->assertEquals($expectedTraceAsString, $reflTrace->getValue($formatter));
52 $reflDepth = new\ReflectionProperty($formatter,
'maxNestingLevel');
53 $reflDepth->setAccessible(
true);
54 $this->assertEquals($expectedTraceDepth, $reflDepth->getValue($formatter));
◆ testFormatDepthArray()
Monolog\Formatter\MongoDBFormatterTest::testFormatDepthArray |
( |
| ) |
|
Definition at line 131 of file MongoDBFormatterTest.php.
References array, Monolog\Logger\getLevelName(), and Monolog\Logger\WARNING.
134 'message' =>
'some log message',
137 'property' =>
'anything',
140 'property' =>
'nothing',
147 'datetime' =>
new \DateTime(
'2014-02-01 00:00:00'),
151 $formatter =
new MongoDBFormatter(2);
152 $formattedResult = $formatter->format($record);
157 'property' =>
'anything',
161 $formattedResult[
'context']
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
◆ testFormatDepthArrayInfiniteNesting()
Monolog\Formatter\MongoDBFormatterTest::testFormatDepthArrayInfiniteNesting |
( |
| ) |
|
Definition at line 165 of file MongoDBFormatterTest.php.
References array, Monolog\Logger\getLevelName(), and Monolog\Logger\WARNING.
168 'message' =>
'some log message',
171 'property' =>
'something',
173 'property' =>
'anything',
175 'property' =>
'nothing',
183 'datetime' =>
new \DateTime(
'2014-02-01 00:00:00'),
187 $formatter =
new MongoDBFormatter(0);
188 $formattedResult = $formatter->format($record);
193 'property' =>
'something',
195 'property' =>
'anything',
197 'property' =>
'nothing',
202 $formattedResult[
'context']
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
◆ testFormatDepthException()
Monolog\Formatter\MongoDBFormatterTest::testFormatDepthException |
( |
| ) |
|
Definition at line 241 of file MongoDBFormatterTest.php.
References array, Monolog\Logger\getLevelName(), and Monolog\Logger\WARNING.
244 'message' =>
'some log message',
246 'nest2' =>
new \
Exception(
'exception message', 987),
251 'datetime' =>
new \DateTime(
'2014-02-01 00:00:00'),
255 $formatter =
new MongoDBFormatter(2,
false);
256 $formattedRecord = $formatter->format($record);
258 $this->assertEquals(
'exception message', $formattedRecord[
'context'][
'nest2'][
'message']);
259 $this->assertEquals(987, $formattedRecord[
'context'][
'nest2'][
'code']);
260 $this->assertEquals(
'[...]', $formattedRecord[
'context'][
'nest2'][
'trace']);
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
◆ testFormatDepthObjects()
Monolog\Formatter\MongoDBFormatterTest::testFormatDepthObjects |
( |
| ) |
|
Definition at line 206 of file MongoDBFormatterTest.php.
References array, Monolog\Logger\getLevelName(), and Monolog\Logger\WARNING.
208 $someObject = new \stdClass();
209 $someObject->property =
'anything';
210 $someObject->nest3 = new \stdClass();
211 $someObject->nest3->property =
'nothing';
212 $someObject->nest3->nest4 =
'invisible';
215 'message' =>
'some log message',
217 'nest2' => $someObject,
222 'datetime' =>
new \DateTime(
'2014-02-01 00:00:00'),
226 $formatter =
new MongoDBFormatter(2,
true);
227 $formattedResult = $formatter->format($record);
232 'property' =>
'anything',
234 'class' =>
'stdClass',
237 $formattedResult[
'context']
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
◆ testRecursiveFormat()
Monolog\Formatter\MongoDBFormatterTest::testRecursiveFormat |
( |
| ) |
|
Definition at line 83 of file MongoDBFormatterTest.php.
References array, Monolog\Logger\getLevelName(), and Monolog\Logger\WARNING.
85 $someObject = new \stdClass();
86 $someObject->foo =
'something';
87 $someObject->bar =
'stuff';
90 'message' =>
'some log message',
92 'stuff' =>
new \DateTime(
'2014-02-01 02:31:33'),
93 'some_object' => $someObject,
94 'context_string' =>
'some string',
95 'context_int' => 123456,
96 'except' =>
new \
Exception(
'exception message', 987),
101 'datetime' =>
new \DateTime(
'2014-02-01 00:00:00'),
105 $formatter =
new MongoDBFormatter();
106 $formattedRecord = $formatter->format($record);
108 $this->assertCount(5, $formattedRecord[
'context']);
109 $this->assertInstanceOf(
'\MongoDate', $formattedRecord[
'context'][
'stuff']);
110 $this->assertEquals(
'0.00000000 1391221893', $formattedRecord[
'context'][
'stuff']->__toString());
113 'foo' =>
'something',
115 'class' =>
'stdClass',
117 $formattedRecord[
'context'][
'some_object']
119 $this->assertEquals(
'some string', $formattedRecord[
'context'][
'context_string']);
120 $this->assertEquals(123456, $formattedRecord[
'context'][
'context_int']);
122 $this->assertCount(5, $formattedRecord[
'context'][
'except']);
123 $this->assertEquals(
'exception message', $formattedRecord[
'context'][
'except'][
'message']);
124 $this->assertEquals(987, $formattedRecord[
'context'][
'except'][
'code']);
125 $this->assertInternalType(
'string', $formattedRecord[
'context'][
'except'][
'file']);
126 $this->assertInternalType(
'integer', $formattedRecord[
'context'][
'except'][
'code']);
127 $this->assertInternalType(
'string', $formattedRecord[
'context'][
'except'][
'trace']);
128 $this->assertEquals(
'Exception', $formattedRecord[
'context'][
'except'][
'class']);
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
◆ testSimpleFormat()
Monolog\Formatter\MongoDBFormatterTest::testSimpleFormat |
( |
| ) |
|
Definition at line 57 of file MongoDBFormatterTest.php.
References array, Monolog\Logger\getLevelName(), and Monolog\Logger\WARNING.
60 'message' =>
'some log message',
65 'datetime' =>
new \DateTime(
'2014-02-01 00:00:00'),
69 $formatter =
new MongoDBFormatter();
70 $formattedRecord = $formatter->format($record);
72 $this->assertCount(7, $formattedRecord);
73 $this->assertEquals(
'some log message', $formattedRecord[
'message']);
74 $this->assertEquals(
array(), $formattedRecord[
'context']);
77 $this->assertEquals(
'test', $formattedRecord[
'channel']);
78 $this->assertInstanceOf(
'\MongoDate', $formattedRecord[
'datetime']);
79 $this->assertEquals(
'0.00000000 1391212800', $formattedRecord[
'datetime']->__toString());
80 $this->assertEquals(
array(), $formattedRecord[
'extra']);
const WARNING
Exceptional occurrences that are not errors.
Create styles array
The data for the language used.
static getLevelName($level)
Gets the name of the logging level.
The documentation for this class was generated from the following file: