ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Monolog\Formatter\ChromePHPFormatterTest Class Reference
+ Inheritance diagram for Monolog\Formatter\ChromePHPFormatterTest:
+ Collaboration diagram for Monolog\Formatter\ChromePHPFormatterTest:

Public Member Functions

 testDefaultFormat ()
 Monologformat More...
 
 testFormatWithFileAndLine ()
 Monologformat More...
 
 testFormatWithoutContext ()
 Monologformat More...
 
 testBatchFormatThrowException ()
 Monolog::formatBatch More...
 

Detailed Description

Definition at line 16 of file ChromePHPFormatterTest.php.

Member Function Documentation

◆ testBatchFormatThrowException()

Monolog\Formatter\ChromePHPFormatterTest::testBatchFormatThrowException ( )

Monolog::formatBatch

Definition at line 116 of file ChromePHPFormatterTest.php.

References $records, array, Monolog\Logger\INFO, and Monolog\Logger\WARNING.

117  {
118  $formatter = new ChromePHPFormatter();
119  $records = array(
120  array(
121  'level' => Logger::INFO,
122  'level_name' => 'INFO',
123  'channel' => 'meh',
124  'context' => array(),
125  'datetime' => new \DateTime("@0"),
126  'extra' => array(),
127  'message' => 'log',
128  ),
129  array(
130  'level' => Logger::WARNING,
131  'level_name' => 'WARNING',
132  'channel' => 'foo',
133  'context' => array(),
134  'datetime' => new \DateTime("@0"),
135  'extra' => array(),
136  'message' => 'log2',
137  ),
138  );
139 
140  $this->assertEquals(
141  array(
142  array(
143  'meh',
144  'log',
145  'unknown',
146  'info',
147  ),
148  array(
149  'foo',
150  'log2',
151  'unknown',
152  'warn',
153  ),
154  ),
155  $formatter->formatBatch($records)
156  );
157  }
$records
Definition: simple_test.php:22
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52
Create styles array
The data for the language used.
const INFO
Interesting events.
Definition: Logger.php:39

◆ testDefaultFormat()

Monolog\Formatter\ChromePHPFormatterTest::testDefaultFormat ( )

Monologformat

Definition at line 21 of file ChromePHPFormatterTest.php.

References $message, array, and Monolog\Logger\ERROR.

22  {
23  $formatter = new ChromePHPFormatter();
24  $record = array(
25  'level' => Logger::ERROR,
26  'level_name' => 'ERROR',
27  'channel' => 'meh',
28  'context' => array('from' => 'logger'),
29  'datetime' => new \DateTime("@0"),
30  'extra' => array('ip' => '127.0.0.1'),
31  'message' => 'log',
32  );
33 
34  $message = $formatter->format($record);
35 
36  $this->assertEquals(
37  array(
38  'meh',
39  array(
40  'message' => 'log',
41  'context' => array('from' => 'logger'),
42  'extra' => array('ip' => '127.0.0.1'),
43  ),
44  'unknown',
45  'error',
46  ),
47  $message
48  );
49  }
const ERROR
Runtime errors.
Definition: Logger.php:57
catch(Exception $e) $message
Create styles array
The data for the language used.

◆ testFormatWithFileAndLine()

Monolog\Formatter\ChromePHPFormatterTest::testFormatWithFileAndLine ( )

Monologformat

Definition at line 54 of file ChromePHPFormatterTest.php.

References $message, array, and Monolog\Logger\CRITICAL.

55  {
56  $formatter = new ChromePHPFormatter();
57  $record = array(
58  'level' => Logger::CRITICAL,
59  'level_name' => 'CRITICAL',
60  'channel' => 'meh',
61  'context' => array('from' => 'logger'),
62  'datetime' => new \DateTime("@0"),
63  'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14),
64  'message' => 'log',
65  );
66 
67  $message = $formatter->format($record);
68 
69  $this->assertEquals(
70  array(
71  'meh',
72  array(
73  'message' => 'log',
74  'context' => array('from' => 'logger'),
75  'extra' => array('ip' => '127.0.0.1'),
76  ),
77  'test : 14',
78  'error',
79  ),
80  $message
81  );
82  }
catch(Exception $e) $message
Create styles array
The data for the language used.
const CRITICAL
Critical conditions.
Definition: Logger.php:64

◆ testFormatWithoutContext()

Monolog\Formatter\ChromePHPFormatterTest::testFormatWithoutContext ( )

Monologformat

Definition at line 87 of file ChromePHPFormatterTest.php.

References $message, array, and Monolog\Logger\DEBUG.

88  {
89  $formatter = new ChromePHPFormatter();
90  $record = array(
91  'level' => Logger::DEBUG,
92  'level_name' => 'DEBUG',
93  'channel' => 'meh',
94  'context' => array(),
95  'datetime' => new \DateTime("@0"),
96  'extra' => array(),
97  'message' => 'log',
98  );
99 
100  $message = $formatter->format($record);
101 
102  $this->assertEquals(
103  array(
104  'meh',
105  'log',
106  'unknown',
107  'log',
108  ),
109  $message
110  );
111  }
const DEBUG
Detailed debug information.
Definition: Logger.php:32
catch(Exception $e) $message
Create styles array
The data for the language used.

The documentation for this class was generated from the following file: