summaryrefslogtreecommitdiff
path: root/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-10-31 14:15:19 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-10-31 14:15:19 +0100
commit411ea5bb6d0ecf32e6c989a99fac120502db9fe9 (patch)
tree736b66c00b26dac8fc9cf4283d4888b0b69b9816 /tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
parent915cbee3e099cc7d48f71f6627b5fde3942cbe88 (diff)
Refactored service provider tests
Diffstat (limited to 'tests/Unit/Exceptions/ExceptionsServiceProviderTest.php')
-rw-r--r--tests/Unit/Exceptions/ExceptionsServiceProviderTest.php20
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
index 26eddb75..fc48d39e 100644
--- a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
+++ b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
@@ -2,13 +2,12 @@
namespace Engelsystem\Test\Exceptions;
-use Engelsystem\Application;
use Engelsystem\Exceptions\ExceptionsServiceProvider;
use Engelsystem\Exceptions\Handler as ExceptionHandler;
-use PHPUnit\Framework\TestCase;
+use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject;
-class ExceptionsServiceProviderTest extends TestCase
+class ExceptionsServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::register()
@@ -19,19 +18,10 @@ class ExceptionsServiceProviderTest extends TestCase
$exceptionHandler = $this->getMockBuilder(ExceptionHandler::class)
->getMock();
- /** @var PHPUnit_Framework_MockObject_MockObject|Application $app */
- $app = $this->getMockBuilder(Application::class)
- ->setMethods(['make', 'instance'])
- ->getMock();
-
- $app->expects($this->once())
- ->method('make')
- ->with(ExceptionHandler::class)
- ->willReturn($exceptionHandler);
+ $app = $this->getApp();
- $app->expects($this->once())
- ->method('instance')
- ->with('error.handler', $exceptionHandler);
+ $this->setExpects($app, 'make', [ExceptionHandler::class], $exceptionHandler);
+ $this->setExpects($app, 'instance', ['error.handler', $exceptionHandler]);
$serviceProvider = new ExceptionsServiceProvider($app);
$serviceProvider->register();