38 fseek($this->resource, 0);
39 $content = fread($this->resource, 1024);
41 $this->assertRegexp(
'/testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] test.CRITICAL: Critical write test/', $content);
49 fseek($this->resource, 0);
50 $content = fread($this->resource, 1024);
52 $this->assertRegexp(
'/(testToken \[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\] .* \[\] \[\]\n){3}/', $content);
57 $useSSL = extension_loaded(
'openssl');
58 $args = array(
'testToken',
'us', $useSSL,
Logger::DEBUG,
true);
59 $this->resource =
fopen(
'php://memory',
'a');
60 $this->handler = $this->getMock(
61 '\Monolog\Handler\InsightOpsHandler',
62 array(
'fsockopen',
'streamSetTimeout',
'closeSocket'),
66 $reflectionProperty = new \ReflectionProperty(
'\Monolog\Handler\SocketHandler',
'connectionString');
67 $reflectionProperty->setAccessible(
true);
68 $reflectionProperty->setValue($this->handler,
'localhost:1234');
70 $this->handler->expects($this->any())
72 ->will($this->returnValue($this->resource));
73 $this->handler->expects($this->any())
74 ->method(
'streamSetTimeout')
75 ->will($this->returnValue(
true));
76 $this->handler->expects($this->any())
77 ->method(
'closeSocket')
78 ->will($this->returnValue(
true));
const DEBUG
Detailed debug information.
getRecord($level=Logger::WARNING, $message='test', $context=array())
const CRITICAL
Critical conditions.