Skip to content
Permalink
Browse files

Remove use of TestCase::getMock() from "Log" namepace tests.

  • Loading branch information...
ADmad committed Jun 5, 2016
1 parent 352d01d commit 6f37ab7c97408512ebe59ff22ae0cab4abdf9379
Showing with 12 additions and 4 deletions.
  1. +12 −4 tests/TestCase/Log/Engine/SyslogLogTest.php
@@ -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 @@ public function testOpenLog()
*/
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 @@ public function testWriteOneLine($type, $expected)
*/
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');

0 comments on commit 6f37ab7

Please sign in to comment.
You can’t perform that action at this time.