Skip to content

Commit df1e4e0

Browse files
committed
Updating tests
1 parent 0634efb commit df1e4e0

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

tests/TestCase/Database/Log/QueryLoggerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public function testLogFunction() {
9090
$query->query = 'SELECT a FROM b where a = ? AND b = ? AND c = ?';
9191
$query->params = ['string', '3', null];
9292

93-
$engine = $this->getMock('\Cake\Log\Engine\BaseLog', ['write'], ['scopes' => ['queriesLog']]);
93+
$engine = $this->getMock('\Cake\Log\Engine\BaseLog', ['log'], ['scopes' => ['queriesLog']]);
9494
Log::engine('queryLoggerTest', $engine);
9595

96-
$engine2 = $this->getMock('\Cake\Log\Engine\BaseLog', ['write'], ['scopes' => ['foo']]);
96+
$engine2 = $this->getMock('\Cake\Log\Engine\BaseLog', ['log'], ['scopes' => ['foo']]);
9797
Log::engine('queryLoggerTest2', $engine2);
9898

99-
$engine2->expects($this->never())->method('write');
99+
$engine2->expects($this->never())->method('log');
100100
$logger->log($query);
101101
}
102102

tests/TestCase/Error/DebuggerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,18 +447,18 @@ public function testExportVarZero() {
447447
* @return void
448448
*/
449449
public function testLog() {
450-
$mock = $this->getMock('Cake\Log\Engine\BaseLog', ['write']);
450+
$mock = $this->getMock('Cake\Log\Engine\BaseLog', ['log']);
451451
Log::config('test', ['engine' => $mock]);
452452

453453
$mock->expects($this->at(0))
454-
->method('write')
454+
->method('log')
455455
->with('debug', $this->logicalAnd(
456456
$this->stringContains('DebuggerTest::testLog'),
457457
$this->stringContains('cool')
458458
));
459459

460460
$mock->expects($this->at(1))
461-
->method('write')
461+
->method('log')
462462
->with('debug', $this->logicalAnd(
463463
$this->stringContains('DebuggerTest::testLog'),
464464
$this->stringContains('[main]'),
@@ -478,11 +478,11 @@ public function testLog() {
478478
* @return void
479479
*/
480480
public function testLogDepth() {
481-
$mock = $this->getMock('Cake\Log\Engine\BaseLog', ['write']);
481+
$mock = $this->getMock('Cake\Log\Engine\BaseLog', ['log']);
482482
Log::config('test', ['engine' => $mock]);
483483

484484
$mock->expects($this->at(0))
485-
->method('write')
485+
->method('log')
486486
->with('debug', $this->logicalAnd(
487487
$this->stringContains('DebuggerTest::testLog'),
488488
$this->stringContains('test'),

tests/TestCase/Error/ErrorHandlerTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function setUp() {
8282
Router::setRequestInfo($request);
8383
Configure::write('debug', true);
8484

85-
$this->_logger = $this->getMock('Cake\Log\LogInterface');
85+
$this->_logger = $this->getMock('Psr\Log\LoggerInterface');
8686

8787
Log::reset();
8888
Log::config('error_test', [
@@ -183,7 +183,7 @@ public function testHandleErrorDebugOff() {
183183
$this->_restoreError = true;
184184

185185
$this->_logger->expects($this->once())
186-
->method('write')
186+
->method('log')
187187
->with(
188188
$this->matchesRegularExpression('(notice|debug)'),
189189
'Notice (8): Undefined variable: out in [' . __FILE__ . ', line ' . (__LINE__ + 3) . ']' . "\n\n"
@@ -204,7 +204,7 @@ public function testHandleErrorLoggingTrace() {
204204
$this->_restoreError = true;
205205

206206
$this->_logger->expects($this->once())
207-
->method('write')
207+
->method('log')
208208
->with(
209209
$this->matchesRegularExpression('(notice|debug)'),
210210
$this->logicalAnd(
@@ -243,7 +243,7 @@ public function testHandleExceptionLog() {
243243
$error = new NotFoundException('Kaboom!');
244244

245245
$this->_logger->expects($this->once())
246-
->method('write')
246+
->method('log')
247247
->with('error', $this->logicalAnd(
248248
$this->stringContains('[Cake\Network\Exception\NotFoundException] Kaboom!'),
249249
$this->stringContains('ErrorHandlerTest->testHandleExceptionLog')
@@ -263,7 +263,7 @@ public function testHandleExceptionLogSkipping() {
263263
$forbidden = new ForbiddenException('Fooled you!');
264264

265265
$this->_logger->expects($this->once())
266-
->method('write')
266+
->method('log')
267267
->with(
268268
'error',
269269
$this->stringContains('[Cake\Network\Exception\ForbiddenException] Fooled you!')
@@ -332,14 +332,14 @@ public function testHandleFatalErrorPage() {
332332
*/
333333
public function testHandleFatalErrorLog() {
334334
$this->_logger->expects($this->at(0))
335-
->method('write')
335+
->method('log')
336336
->with('error', $this->logicalAnd(
337337
$this->stringContains(__FILE__ . ', line ' . (__LINE__ + 9)),
338338
$this->stringContains('Fatal Error (1)'),
339339
$this->stringContains('Something wrong')
340340
));
341341
$this->_logger->expects($this->at(1))
342-
->method('write')
342+
->method('log')
343343
->with('error', $this->stringContains('[Cake\Error\FatalErrorException] Something wrong'));
344344

345345
$errorHandler = new TestErrorHandler(['log' => true]);

tests/TestCase/Network/Email/EmailTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,12 +1277,12 @@ public function testSendWithNoContentDispositionAttachments() {
12771277
* @return void
12781278
*/
12791279
public function testSendWithLog() {
1280-
$log = $this->getMock('Cake\Log\Engine\BaseLog', ['write'], [['scopes' => 'email']]);
1280+
$log = $this->getMock('Cake\Log\Engine\BaseLog', ['log'], [['scopes' => 'email']]);
12811281

12821282
$message = 'Logging This';
12831283

12841284
$log->expects($this->once())
1285-
->method('write')
1285+
->method('log')
12861286
->with(
12871287
'debug',
12881288
$this->logicalAnd(
@@ -1310,9 +1310,9 @@ public function testSendWithLog() {
13101310
public function testSendWithLogAndScope() {
13111311
$message = 'Logging This';
13121312

1313-
$log = $this->getMock('Cake\Log\Engine\BaseLog', ['write'], ['scopes' => ['email']]);
1313+
$log = $this->getMock('Cake\Log\Engine\BaseLog', ['log'], ['scopes' => ['email']]);
13141314
$log->expects($this->once())
1315-
->method('write')
1315+
->method('log')
13161316
->with(
13171317
'debug',
13181318
$this->logicalAnd(

0 commit comments

Comments
 (0)