38 $content = fread($this->res, 1024);
40 $this->assertRegexp(
'/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content);
51 $this->handler->handleBatch(
$records);
54 $content = fread($this->res, 1024);
56 $this->assertRegexp(
'/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content);
61 $useSSL = extension_loaded(
'openssl');
63 $this->res = fopen(
'php://memory',
'a');
64 $this->handler = $this->getMock(
65 '\Monolog\Handler\LogEntriesHandler',
66 array(
'fsockopen',
'streamSetTimeout',
'closeSocket'),
70 $reflectionProperty = new \ReflectionProperty(
'\Monolog\Handler\SocketHandler',
'connectionString');
71 $reflectionProperty->setAccessible(
true);
72 $reflectionProperty->setValue($this->handler,
'localhost:1234');
74 $this->handler->expects($this->any())
76 ->will($this->returnValue($this->res));
77 $this->handler->expects($this->any())
78 ->method(
'streamSetTimeout')
79 ->will($this->returnValue(
true));
80 $this->handler->expects($this->any())
81 ->method(
'closeSocket')
82 ->will($this->returnValue(
true));
const DEBUG
Detailed debug information.
getRecord($level=Logger::WARNING, $message='test', $context=array())
Create styles array
The data for the language used.
const CRITICAL
Critical conditions.