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

Public Member Functions

 setUp ()
 
 trueFalseDataProvider ()
 
 testIsHandling ($result)
 
 testHandle ($result)
 
 testHandleBatch ($result)
 
 testPushProcessor ()
 
 testPopProcessor ()
 
 testSetFormatter ()
 
 testGetFormatter ()
 

Private Attributes

 $wrapper
 
 $handler
 

Additional Inherited Members

- Protected Member Functions inherited from Monolog\TestCase
 getRecord ($level=Logger::WARNING, $message='test', $context=array())
 
 getMultipleRecords ()
 
 getIdentityFormatter ()
 

Detailed Description

Author
Alexey Karapetov alexe.nosp@m.y@ka.nosp@m.rapet.nosp@m.ov.c.nosp@m.om

Definition at line 19 of file HandlerWrapperTest.php.

Member Function Documentation

◆ setUp()

Monolog\Handler\HandlerWrapperTest::setUp ( )

Definition at line 28 of file HandlerWrapperTest.php.

29 {
30 parent::setUp();
31 $this->handler = $this->getMock('Monolog\\Handler\\HandlerInterface');
32 $this->wrapper = new HandlerWrapper($this->handler);
33 }

◆ testGetFormatter()

Monolog\Handler\HandlerWrapperTest::testGetFormatter ( )

Definition at line 121 of file HandlerWrapperTest.php.

122 {
123 $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
124 $this->handler->expects($this->once())
125 ->method('getFormatter')
126 ->willReturn($formatter);
127
128 $this->assertEquals($formatter, $this->wrapper->getFormatter());
129 }

◆ testHandle()

Monolog\Handler\HandlerWrapperTest::testHandle (   $result)
Parameters
$result@dataProvider trueFalseDataProvider

Definition at line 65 of file HandlerWrapperTest.php.

66 {
67 $record = $this->getRecord();
68 $this->handler->expects($this->once())
69 ->method('handle')
70 ->with($record)
71 ->willReturn($result);
72
73 $this->assertEquals($result, $this->wrapper->handle($record));
74 }
$result
getRecord($level=Logger::WARNING, $message='test', $context=array())
Definition: TestCase.php:19

References $result, and Monolog\TestCase\getRecord().

+ Here is the call graph for this function:

◆ testHandleBatch()

Monolog\Handler\HandlerWrapperTest::testHandleBatch (   $result)
Parameters
$result@dataProvider trueFalseDataProvider

Definition at line 80 of file HandlerWrapperTest.php.

81 {
83 $this->handler->expects($this->once())
84 ->method('handleBatch')
85 ->with($records)
86 ->willReturn($result);
87
88 $this->assertEquals($result, $this->wrapper->handleBatch($records));
89 }
$records
Definition: simple_test.php:22

References $records, $result, and Monolog\TestCase\getMultipleRecords().

+ Here is the call graph for this function:

◆ testIsHandling()

Monolog\Handler\HandlerWrapperTest::testIsHandling (   $result)
Parameters
$result@dataProvider trueFalseDataProvider

Definition at line 50 of file HandlerWrapperTest.php.

51 {
52 $record = $this->getRecord();
53 $this->handler->expects($this->once())
54 ->method('isHandling')
55 ->with($record)
56 ->willReturn($result);
57
58 $this->assertEquals($result, $this->wrapper->isHandling($record));
59 }

References $result, and Monolog\TestCase\getRecord().

+ Here is the call graph for this function:

◆ testPopProcessor()

Monolog\Handler\HandlerWrapperTest::testPopProcessor ( )

Definition at line 101 of file HandlerWrapperTest.php.

102 {
103 $processor = function () {};
104 $this->handler->expects($this->once())
105 ->method('popProcessor')
106 ->willReturn($processor);
107
108 $this->assertEquals($processor, $this->wrapper->popProcessor());
109 }

◆ testPushProcessor()

Monolog\Handler\HandlerWrapperTest::testPushProcessor ( )

Definition at line 91 of file HandlerWrapperTest.php.

92 {
93 $processor = function () {};
94 $this->handler->expects($this->once())
95 ->method('pushProcessor')
96 ->with($processor);
97
98 $this->assertEquals($this->wrapper, $this->wrapper->pushProcessor($processor));
99 }

◆ testSetFormatter()

Monolog\Handler\HandlerWrapperTest::testSetFormatter ( )

Definition at line 111 of file HandlerWrapperTest.php.

112 {
113 $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
114 $this->handler->expects($this->once())
115 ->method('setFormatter')
116 ->with($formatter);
117
118 $this->assertEquals($this->wrapper, $this->wrapper->setFormatter($formatter));
119 }

◆ trueFalseDataProvider()

Monolog\Handler\HandlerWrapperTest::trueFalseDataProvider ( )
Returns
array

Definition at line 38 of file HandlerWrapperTest.php.

39 {
40 return array(
41 array(true),
42 array(false),
43 );
44 }

Field Documentation

◆ $handler

Monolog\Handler\HandlerWrapperTest::$handler
private

Definition at line 26 of file HandlerWrapperTest.php.

◆ $wrapper

Monolog\Handler\HandlerWrapperTest::$wrapper
private

Definition at line 24 of file HandlerWrapperTest.php.


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