Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elazar committed Apr 4, 2020
1 parent 7053c6d commit 040a831
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions Slim/Logger.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php

/**
* Slim Framework (https://slimframework.com)
*
* @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
*/

declare(strict_types=1);

namespace Slim;

use Psr\Log\AbstractLogger;
Expand Down
2 changes: 1 addition & 1 deletion tests/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public function testAddErrorMiddleware()
$responseFactory = $this->prophesize(ResponseFactoryInterface::class)->reveal();

/** @var LoggerInterface $logger */
$logger = $this->createMock(LoggerInterface::class);
$logger = $this->prophesize(LoggerInterface::class)->reveal();

// Create the app.
$app = new App($responseFactory);
Expand Down
10 changes: 5 additions & 5 deletions tests/Handlers/ErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

class ErrorHandlerTest extends TestCase
{
private function getMockLogger(): LoggerInterface
{
return $this->createMock(LoggerInterface::class);
}

public function testDetermineRenderer()
{
$handler = $this
Expand Down Expand Up @@ -392,9 +397,4 @@ public function testLogErrorRenderer()
$writeToErrorLogMethod->setAccessible(true);
$writeToErrorLogMethod->invoke($handler);
}

private function getMockLogger(): LoggerInterface
{
return $this->createMock(LoggerInterface::class);
}
}
10 changes: 5 additions & 5 deletions tests/Middleware/ErrorMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

class ErrorMiddlewareTest extends TestCase
{
private function getMockLogger(): LoggerInterface
{
return $this->createMock(LoggerInterface::class);
}

public function testSetErrorHandler()
{
$responseFactory = $this->getResponseFactory();
Expand Down Expand Up @@ -284,9 +289,4 @@ public function testErrorHandlerHandlesThrowables()

$this->expectOutputString('Oops..');
}

private function getMockLogger(): LoggerInterface
{
return $this->createMock(LoggerInterface::class);
}
}

0 comments on commit 040a831

Please sign in to comment.