@covers Monolog\Handler\TestHandler
More...
@covers Monolog\Handler\TestHandler
Definition at line 20 of file TestHandlerTest.php.
◆ methodProvider()
Monolog\Handler\TestHandlerTest::methodProvider |
( |
| ) |
|
Definition at line 103 of file TestHandlerTest.php.
104 {
105 return array(
114 );
115 }
const EMERGENCY
Urgent alert.
const ERROR
Runtime errors.
const CRITICAL
Critical conditions.
const WARNING
Exceptional occurrences that are not errors.
const INFO
Interesting events.
const DEBUG
Detailed debug information.
const NOTICE
Uncommon events.
const ALERT
Action must be taken immediately.
References DEBUG.
◆ testHandler()
Monolog\Handler\TestHandlerTest::testHandler |
( |
|
$method, |
|
|
|
$level |
|
) |
| |
@dataProvider methodProvider
Definition at line 25 of file TestHandlerTest.php.
26 {
28 $record = $this->
getRecord($level,
'test'.$method);
29 $this->assertFalse(
$handler->hasRecords($level));
30 $this->assertFalse(
$handler->hasRecord($record, $level));
31 $this->assertFalse(
$handler->{
'has'.$method}($record),
'has'.$method);
32 $this->assertFalse(
$handler->{
'has'.$method.
'ThatContains'}(
'test'),
'has'.$method.
'ThatContains');
33 $this->assertFalse(
$handler->{
'has'.$method.
'ThatPasses'}(
function ($rec) {
34 return true;
35 }), 'has'.$method.'ThatPasses');
36 $this->assertFalse(
$handler->{
'has'.$method.
'ThatMatches'}(
'/test\w+/'));
37 $this->assertFalse(
$handler->{
'has'.$method.
'Records'}(),
'has'.$method.
'Records');
39
40 $this->assertFalse(
$handler->{
'has'.$method}(
'bar'),
'has'.$method);
41 $this->assertTrue(
$handler->hasRecords($level));
42 $this->assertTrue(
$handler->hasRecord($record, $level));
43 $this->assertTrue(
$handler->{
'has'.$method}($record),
'has'.$method);
44 $this->assertTrue(
$handler->{
'has'.$method}(
'test'.$method),
'has'.$method);
45 $this->assertTrue(
$handler->{
'has'.$method.
'ThatContains'}(
'test'),
'has'.$method.
'ThatContains');
46 $this->assertTrue(
$handler->{
'has'.$method.
'ThatPasses'}(
function ($rec) {
47 return true;
48 }), 'has'.$method.'ThatPasses');
49 $this->assertTrue(
$handler->{
'has'.$method.
'ThatMatches'}(
'/test\w+/'));
50 $this->assertTrue(
$handler->{
'has'.$method.
'Records'}(),
'has'.$method.
'Records');
51
54 $this->assertEquals(array($record),
$records);
55 }
getRecord($level=Logger::WARNING, $message='test', $context=array())
References $handler, and Monolog\TestCase\getRecord().
◆ testHandlerAssertEmptyContext()
Monolog\Handler\TestHandlerTest::testHandlerAssertEmptyContext |
( |
| ) |
|
Definition at line 57 of file TestHandlerTest.php.
57 {
60 $this->assertFalse(
$handler->hasWarning(array(
61 'message' => 'test',
62 'context' => array(),
63 )));
64
66
67 $this->assertTrue(
$handler->hasWarning(array(
68 'message' => 'test',
69 'context' => array(),
70 )));
71 $this->assertFalse(
$handler->hasWarning(array(
72 'message' => 'test',
73 'context' => array(
74 'foo' => 'bar'
75 ),
76 )));
77 }
References $handler.
◆ testHandlerAssertNonEmptyContext()
Monolog\Handler\TestHandlerTest::testHandlerAssertNonEmptyContext |
( |
| ) |
|
Definition at line 79 of file TestHandlerTest.php.
79 {
82 $this->assertFalse(
$handler->hasWarning(array(
83 'message' => 'test',
84 'context' => array(
85 'foo' => 'bar'
86 ),
87 )));
88
90
91 $this->assertTrue(
$handler->hasWarning(array(
92 'message' => 'test',
93 'context' => array(
94 'foo' => 'bar'
95 ),
96 )));
97 $this->assertFalse(
$handler->hasWarning(array(
98 'message' => 'test',
99 'context' => array(),
100 )));
101 }
References $handler.
The documentation for this class was generated from the following file: