@covers Monolog\Handler\ChromePHPHandler
More...
@covers Monolog\Handler\ChromePHPHandler
Definition at line 20 of file ChromePHPHandlerTest.php.
◆ agentsProvider()
static Monolog\Handler\ChromePHPHandlerTest::agentsProvider |
( |
| ) |
|
|
static |
Definition at line 55 of file ChromePHPHandlerTest.php.
56 {
57 return array(
58 array('Monolog Test; Chrome/1.0'),
59 array('Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'),
60 array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36'),
61 array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome Safari/537.36'),
62 );
63 }
◆ setUp()
Monolog\Handler\ChromePHPHandlerTest::setUp |
( |
| ) |
|
|
protected |
◆ testConcurrentHandlers()
Monolog\Handler\ChromePHPHandlerTest::testConcurrentHandlers |
( |
| ) |
|
Definition at line 105 of file ChromePHPHandlerTest.php.
106 {
107 $handler =
new TestChromePHPHandler();
111
112 $handler2 = new TestChromePHPHandler();
116
117 $expected = array(
118 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array(
120 'columns' => array('label', 'log', 'backtrace', 'type'),
121 'rows' => array(
122 'test',
123 'test',
124 'test',
125 'test',
126 ),
127 'request_uri' => '',
128 )))),
129 );
130
131 $this->assertEquals($expected, $handler2->getHeaders());
132 }
const VERSION
Version of the extension.
const WARNING
Exceptional occurrences that are not errors.
const DEBUG
Detailed debug information.
getRecord($level=Logger::WARNING, $message='test', $context=array())
References $handler, Monolog\Logger\DEBUG, Monolog\TestCase\getIdentityFormatter(), Monolog\TestCase\getRecord(), Monolog\Handler\ChromePHPHandler\VERSION, and Monolog\Logger\WARNING.
◆ testHeaders()
Monolog\Handler\ChromePHPHandlerTest::testHeaders |
( |
|
$agent | ) |
|
@dataProvider agentsProvider
Definition at line 31 of file ChromePHPHandlerTest.php.
32 {
33 $_SERVER[
'HTTP_USER_AGENT'] = $agent;
34
35 $handler =
new TestChromePHPHandler();
39
40 $expected = array(
41 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array(
43 'columns' => array('label', 'log', 'backtrace', 'type'),
44 'rows' => array(
45 'test',
46 'test',
47 ),
48 'request_uri' => '',
49 )))),
50 );
51
52 $this->assertEquals($expected,
$handler->getHeaders());
53 }
References $_SERVER, $handler, Monolog\Logger\DEBUG, Monolog\TestCase\getIdentityFormatter(), Monolog\TestCase\getRecord(), Monolog\Handler\ChromePHPHandler\VERSION, and Monolog\Logger\WARNING.
◆ testHeadersOverflow()
Monolog\Handler\ChromePHPHandlerTest::testHeadersOverflow |
( |
| ) |
|
Definition at line 65 of file ChromePHPHandlerTest.php.
66 {
67 $handler =
new TestChromePHPHandler();
70
71
73
74 $expected = array(
75 'X-ChromeLogger-Data' => base64_encode(utf8_encode(json_encode(array(
77 'columns' => array('label', 'log', 'backtrace', 'type'),
78 'rows' => array(
79 array(
80 'test',
81 'test',
82 'unknown',
83 'log',
84 ),
85 array(
86 'test',
87 str_repeat('a', 150 * 1024),
88 'unknown',
89 'warn',
90 ),
91 array(
92 'monolog',
93 'Incomplete logs, chrome header size limit reached',
94 'unknown',
95 'warn',
96 ),
97 ),
98 'request_uri' => '',
99 )))),
100 );
101
102 $this->assertEquals($expected,
$handler->getHeaders());
103 }
References $handler, Monolog\Logger\DEBUG, Monolog\TestCase\getRecord(), Monolog\Handler\ChromePHPHandler\VERSION, and Monolog\Logger\WARNING.
The documentation for this class was generated from the following file: