|
|
@@ -29,11 +29,15 @@ class SyslogLogTest extends TestCase
|
|
|
*/
|
|
|
public function testOpenLog()
|
|
|
{
|
|
|
- $log = $this->getMock('Cake\Log\Engine\SyslogLog', ['_open', '_write']);
|
|
|
+ $log = $this->getMockBuilder('Cake\Log\Engine\SyslogLog')
|
|
|
+ ->setMethods(['_open', '_write'])
|
|
|
+ ->getMock();
|
|
|
$log->expects($this->once())->method('_open')->with('', LOG_ODELAY, LOG_USER);
|
|
|
$log->log('debug', 'message');
|
|
|
|
|
|
- $log = $this->getMock('Cake\Log\Engine\SyslogLog', ['_open', '_write']);
|
|
|
+ $log = $this->getMockBuilder('Cake\Log\Engine\SyslogLog')
|
|
|
+ ->setMethods(['_open', '_write'])
|
|
|
+ ->getMock();
|
|
|
$log->config([
|
|
|
'prefix' => 'thing',
|
|
|
'flag' => LOG_NDELAY,
|
|
|
@@ -53,7 +57,9 @@ class SyslogLogTest extends TestCase
|
|
|
*/
|
|
|
public function testWriteOneLine($type, $expected)
|
|
|
{
|
|
|
- $log = $this->getMock('Cake\Log\Engine\SyslogLog', ['_open', '_write']);
|
|
|
+ $log = $this->getMockBuilder('Cake\Log\Engine\SyslogLog')
|
|
|
+ ->setMethods(['_open', '_write'])
|
|
|
+ ->getMock();
|
|
|
$log->expects($this->once())->method('_write')->with($expected, $type . ': Foo');
|
|
|
$log->log($type, 'Foo');
|
|
|
}
|
|
|
@@ -65,7 +71,9 @@ class SyslogLogTest extends TestCase
|
|
|
*/
|
|
|
public function testWriteMultiLine()
|
|
|
{
|
|
|
- $log = $this->getMock('Cake\Log\Engine\SyslogLog', ['_open', '_write']);
|
|
|
+ $log = $this->getMockBuilder('Cake\Log\Engine\SyslogLog')
|
|
|
+ ->setMethods(['_open', '_write'])
|
|
|
+ ->getMock();
|
|
|
$log->expects($this->at(1))->method('_write')->with(LOG_DEBUG, 'debug: Foo');
|
|
|
$log->expects($this->at(2))->method('_write')->with(LOG_DEBUG, 'debug: Bar');
|
|
|
$log->expects($this->exactly(2))->method('_write');
|