ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Monolog\Handler\SyslogUdpHandlerTest Class Reference

@requires extension sockets More...

+ Inheritance diagram for Monolog\Handler\SyslogUdpHandlerTest:
+ Collaboration diagram for Monolog\Handler\SyslogUdpHandlerTest:

Public Member Functions

 testWeValidateFacilities ()
 @expectedException UnexpectedValueException More...
 
 testWeSplitIntoLines ()
 

Protected Member Functions

 getRecordWithMessage ($msg)
 

Detailed Description

@requires extension sockets

Definition at line 17 of file SyslogUdpHandlerTest.php.

Member Function Documentation

◆ getRecordWithMessage()

Monolog\Handler\SyslogUdpHandlerTest::getRecordWithMessage (   $msg)
protected

Definition at line 45 of file SyslogUdpHandlerTest.php.

46 {
47 return array('message' => $msg, 'level' => \Monolog\Logger::WARNING, 'context' => null, 'extra' => array(), 'channel' => 'lol');
48 }
const WARNING
Exceptional occurrences that are not errors.
Definition: Logger.php:52

References Monolog\Logger\WARNING.

Referenced by Monolog\Handler\SyslogUdpHandlerTest\testWeSplitIntoLines().

+ Here is the caller graph for this function:

◆ testWeSplitIntoLines()

Monolog\Handler\SyslogUdpHandlerTest::testWeSplitIntoLines ( )

Definition at line 27 of file SyslogUdpHandlerTest.php.

28 {
29 $handler = new SyslogUdpHandler("127.0.0.1", 514, "authpriv");
30 $handler->setFormatter(new \Monolog\Formatter\ChromePHPFormatter());
31
32 $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('write'), array('lol', 'lol'));
33 $socket->expects($this->at(0))
34 ->method('write')
35 ->with("lol", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 ");
36 $socket->expects($this->at(1))
37 ->method('write')
38 ->with("hej", "<".(LOG_AUTHPRIV + LOG_WARNING).">1 ");
39
40 $handler->setSocket($socket);
41
42 $handler->handle($this->getRecordWithMessage("hej\nlol"));
43 }

References Monolog\Handler\SyslogUdpHandlerTest\getRecordWithMessage().

+ Here is the call graph for this function:

◆ testWeValidateFacilities()

Monolog\Handler\SyslogUdpHandlerTest::testWeValidateFacilities ( )

@expectedException UnexpectedValueException

Definition at line 22 of file SyslogUdpHandlerTest.php.

23 {
24 $handler = new SyslogUdpHandler("ip", null, "invalidFacility");
25 }

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