ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Monolog\Handler\UdpSocketTest Class Reference

extension sockets More...

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

Public Member Functions

 testWeDoNotTruncateShortMessages ()
 
 testLongMessagesAreTruncated ()
 
 testDoubleCloseDoesNotError ()
 
 testWriteAfterCloseErrors ()
 LogicException More...
 

Additional Inherited Members

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

Detailed Description

extension sockets

Definition at line 20 of file UdpSocketTest.php.

Member Function Documentation

◆ testDoubleCloseDoesNotError()

Monolog\Handler\UdpSocketTest::testDoubleCloseDoesNotError ( )

Definition at line 48 of file UdpSocketTest.php.

49  {
50  $socket = new UdpSocket('127.0.0.1', 514);
51  $socket->close();
52  $socket->close();
53  }

◆ testLongMessagesAreTruncated()

Monolog\Handler\UdpSocketTest::testLongMessagesAreTruncated ( )

Definition at line 33 of file UdpSocketTest.php.

34  {
35  $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol'));
36 
37  $truncatedString = str_repeat("derp", 16254).'d';
38 
39  $socket->expects($this->exactly(1))
40  ->method('send')
41  ->with("HEADER" . $truncatedString);
42 
43  $longString = str_repeat("derp", 20000);
44 
45  $socket->write($longString, "HEADER");
46  }

◆ testWeDoNotTruncateShortMessages()

Monolog\Handler\UdpSocketTest::testWeDoNotTruncateShortMessages ( )

Definition at line 22 of file UdpSocketTest.php.

23  {
24  $socket = $this->getMock('\Monolog\Handler\SyslogUdp\UdpSocket', array('send'), array('lol', 'lol'));
25 
26  $socket->expects($this->at(0))
27  ->method('send')
28  ->with("HEADER: The quick brown fox jumps over the lazy dog");
29 
30  $socket->write("The quick brown fox jumps over the lazy dog", "HEADER: ");
31  }

◆ testWriteAfterCloseErrors()

Monolog\Handler\UdpSocketTest::testWriteAfterCloseErrors ( )

LogicException

Definition at line 58 of file UdpSocketTest.php.

59  {
60  $socket = new UdpSocket('127.0.0.1', 514);
61  $socket->close();
62  $socket->write('foo', "HEADER");
63  }

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