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

Public Member Functions

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

Detailed Description

Definition at line 16 of file WildfireFormatterTest.php.

Member Function Documentation

◆ testBatchFormatThrowException()

Monolog\Formatter\WildfireFormatterTest::testBatchFormatThrowException ( )

Monolog::formatBatch BadMethodCallException

Definition at line 96 of file WildfireFormatterTest.php.

References array, and Monolog\Logger\ERROR.

97  {
98  $wildfire = new WildfireFormatter();
99  $record = array(
100  'level' => Logger::ERROR,
101  'level_name' => 'ERROR',
102  'channel' => 'meh',
103  'context' => array(),
104  'datetime' => new \DateTime("@0"),
105  'extra' => array(),
106  'message' => 'log',
107  );
108 
109  $wildfire->formatBatch(array($record));
110  }
const ERROR
Runtime errors.
Definition: Logger.php:57
Create styles array
The data for the language used.

◆ testDefaultFormat()

Monolog\Formatter\WildfireFormatterTest::testDefaultFormat ( )

Monologformat

Definition at line 21 of file WildfireFormatterTest.php.

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

22  {
23  $wildfire = new WildfireFormatter();
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 = $wildfire->format($record);
35 
36  $this->assertEquals(
37  '125|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},'
38  .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|',
39  $message
40  );
41  }
const ERROR
Runtime errors.
Definition: Logger.php:57
catch(Exception $e) $message
Create styles array
The data for the language used.

◆ testFormatWithFileAndLine()

Monolog\Formatter\WildfireFormatterTest::testFormatWithFileAndLine ( )

Monologformat

Definition at line 46 of file WildfireFormatterTest.php.

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

47  {
48  $wildfire = new WildfireFormatter();
49  $record = array(
50  'level' => Logger::ERROR,
51  'level_name' => 'ERROR',
52  'channel' => 'meh',
53  'context' => array('from' => 'logger'),
54  'datetime' => new \DateTime("@0"),
55  'extra' => array('ip' => '127.0.0.1', 'file' => 'test', 'line' => 14),
56  'message' => 'log',
57  );
58 
59  $message = $wildfire->format($record);
60 
61  $this->assertEquals(
62  '129|[{"Type":"ERROR","File":"test","Line":14,"Label":"meh"},'
63  .'{"message":"log","context":{"from":"logger"},"extra":{"ip":"127.0.0.1"}}]|',
64  $message
65  );
66  }
const ERROR
Runtime errors.
Definition: Logger.php:57
catch(Exception $e) $message
Create styles array
The data for the language used.

◆ testFormatWithoutContext()

Monolog\Formatter\WildfireFormatterTest::testFormatWithoutContext ( )

Monologformat

Definition at line 71 of file WildfireFormatterTest.php.

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

72  {
73  $wildfire = new WildfireFormatter();
74  $record = array(
75  'level' => Logger::ERROR,
76  'level_name' => 'ERROR',
77  'channel' => 'meh',
78  'context' => array(),
79  'datetime' => new \DateTime("@0"),
80  'extra' => array(),
81  'message' => 'log',
82  );
83 
84  $message = $wildfire->format($record);
85 
86  $this->assertEquals(
87  '58|[{"Type":"ERROR","File":"","Line":"","Label":"meh"},"log"]|',
88  $message
89  );
90  }
const ERROR
Runtime errors.
Definition: Logger.php:57
catch(Exception $e) $message
Create styles array
The data for the language used.

◆ testTableFormat()

Monolog\Formatter\WildfireFormatterTest::testTableFormat ( )

Monologformat

Definition at line 115 of file WildfireFormatterTest.php.

References $message, array, Monolog\Logger\ERROR, and Monolog\Formatter\WildfireFormatter\TABLE.

116  {
117  $wildfire = new WildfireFormatter();
118  $record = array(
119  'level' => Logger::ERROR,
120  'level_name' => 'ERROR',
121  'channel' => 'table-channel',
122  'context' => array(
124  array('col1', 'col2', 'col3'),
125  array('val1', 'val2', 'val3'),
126  array('foo1', 'foo2', 'foo3'),
127  array('bar1', 'bar2', 'bar3'),
128  ),
129  ),
130  'datetime' => new \DateTime("@0"),
131  'extra' => array(),
132  'message' => 'table-message',
133  );
134 
135  $message = $wildfire->format($record);
136 
137  $this->assertEquals(
138  '171|[{"Type":"TABLE","File":"","Line":"","Label":"table-channel: table-message"},[["col1","col2","col3"],["val1","val2","val3"],["foo1","foo2","foo3"],["bar1","bar2","bar3"]]]|',
139  $message
140  );
141  }
const ERROR
Runtime errors.
Definition: Logger.php:57
catch(Exception $e) $message
Create styles array
The data for the language used.

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