Browse Source

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

ADmad 9 years ago
parent
commit
6f37ab7c97
1 changed files with 12 additions and 4 deletions
  1. 12 4
      tests/TestCase/Log/Engine/SyslogLogTest.php

+ 12 - 4
tests/TestCase/Log/Engine/SyslogLogTest.php

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