summaryrefslogtreecommitdiff
path: root/tests/Unit/Exceptions/Handlers
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-04-24 10:45:00 +0200
committermsquare <msquare@notrademark.de>2019-04-25 17:56:06 +0200
commitc74fa7955d9392aea954c2e45ed4137fb2bebcbe (patch)
tree034c93b4b3ccc31e6cc9c27dd87f139569c10c72 /tests/Unit/Exceptions/Handlers
parentb74835a0968c35ad9a0955dd8b5e2f3cf9b72a56 (diff)
phpunit: Upgrade to version 8, fixed tests, formatting
Use `dms/phpunit-arraysubset-asserts` after `assertArraySubset` got deprecated
Diffstat (limited to 'tests/Unit/Exceptions/Handlers')
-rw-r--r--tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php4
-rw-r--r--tests/Unit/Exceptions/Handlers/LegacyTest.php18
-rw-r--r--tests/Unit/Exceptions/Handlers/WhoopsTest.php16
3 files changed, 19 insertions, 19 deletions
diff --git a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
index d5390c9e..bc4625e9 100644
--- a/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
+++ b/tests/Unit/Exceptions/Handlers/LegacyDevelopmentTest.php
@@ -6,8 +6,8 @@ namespace Engelsystem\Test\Unit\Exceptions\handlers;
use Engelsystem\Exceptions\Handlers\LegacyDevelopment;
use Engelsystem\Http\Request;
use ErrorException;
+use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
-use PHPUnit_Framework_MockObject_MockObject as Mock;
class LegacyDevelopmentTest extends TestCase
{
@@ -18,7 +18,7 @@ class LegacyDevelopmentTest extends TestCase
public function testRender()
{
$handler = new LegacyDevelopment();
- /** @var Request|Mock $request */
+ /** @var Request|MockObject $request */
$request = $this->createMock(Request::class);
$exception = new ErrorException('Lorem Ipsum', 4242, 1, 'foo.php', 9999);
diff --git a/tests/Unit/Exceptions/Handlers/LegacyTest.php b/tests/Unit/Exceptions/Handlers/LegacyTest.php
index 04b214f2..d7d65daf 100644
--- a/tests/Unit/Exceptions/Handlers/LegacyTest.php
+++ b/tests/Unit/Exceptions/Handlers/LegacyTest.php
@@ -6,8 +6,8 @@ namespace Engelsystem\Test\Unit\Exceptions\handlers;
use Engelsystem\Exceptions\Handlers\Legacy;
use Engelsystem\Http\Request;
use Exception;
+use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
-use PHPUnit_Framework_MockObject_MockObject as Mock;
class LegacyTest extends TestCase
{
@@ -17,9 +17,9 @@ class LegacyTest extends TestCase
public function testRender()
{
$handler = new Legacy();
- /** @var Request|Mock $request */
+ /** @var Request|MockObject $request */
$request = $this->createMock(Request::class);
- /** @var Exception|Mock $exception */
+ /** @var Exception|MockObject $exception */
$exception = $this->createMock(Exception::class);
$this->expectOutputRegex('/.*error occurred.*/i');
@@ -45,11 +45,11 @@ class LegacyTest extends TestCase
$logContent = file_get_contents($log);
unset($log);
- $this->assertContains('4242', $logContent);
- $this->assertContains('Lorem Ipsum', $logContent);
- $this->assertContains(basename(__FILE__), $logContent);
- $this->assertContains((string)$line, $logContent);
- $this->assertContains(__FUNCTION__, $logContent);
- $this->assertContains(json_encode(__CLASS__), $logContent);
+ $this->assertStringContainsString('4242', $logContent);
+ $this->assertStringContainsString('Lorem Ipsum', $logContent);
+ $this->assertStringContainsString(basename(__FILE__), $logContent);
+ $this->assertStringContainsString((string)$line, $logContent);
+ $this->assertStringContainsString(__FUNCTION__, $logContent);
+ $this->assertStringContainsString(json_encode(__CLASS__), $logContent);
}
}
diff --git a/tests/Unit/Exceptions/Handlers/WhoopsTest.php b/tests/Unit/Exceptions/Handlers/WhoopsTest.php
index 4949c45a..74bdc457 100644
--- a/tests/Unit/Exceptions/Handlers/WhoopsTest.php
+++ b/tests/Unit/Exceptions/Handlers/WhoopsTest.php
@@ -8,8 +8,8 @@ use Engelsystem\Exceptions\Handlers\Whoops;
use Engelsystem\Helpers\Authenticator;
use Engelsystem\Http\Request;
use Exception;
+use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
-use PHPUnit_Framework_MockObject_MockObject as Mock;
use Whoops\Handler\JsonResponseHandler;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Run as WhoopsRunner;
@@ -22,19 +22,19 @@ class WhoopsTest extends TestCase
*/
public function testRender()
{
- /** @var Application|Mock $app */
+ /** @var Application|MockObject $app */
$app = $this->createMock(Application::class);
- /** @var Authenticator|Mock $auth */
+ /** @var Authenticator|MockObject $auth */
$auth = $this->createMock(Authenticator::class);
- /** @var Request|Mock $request */
+ /** @var Request|MockObject $request */
$request = $this->createMock(Request::class);
- /** @var WhoopsRunnerInterface|Mock $whoopsRunner */
+ /** @var WhoopsRunnerInterface|MockObject $whoopsRunner */
$whoopsRunner = $this->getMockForAbstractClass(WhoopsRunnerInterface::class);
- /** @var PrettyPageHandler|Mock $prettyPageHandler */
+ /** @var PrettyPageHandler|MockObject $prettyPageHandler */
$prettyPageHandler = $this->createMock(PrettyPageHandler::class);
- /** @var JsonResponseHandler|Mock $jsonResponseHandler */
+ /** @var JsonResponseHandler|MockObject $jsonResponseHandler */
$jsonResponseHandler = $this->createMock(JsonResponseHandler::class);
- /** @var Exception|Mock $exception */
+ /** @var Exception|MockObject $exception */
$exception = $this->createMock(Exception::class);
$request->expects($this->once())