summaryrefslogtreecommitdiff
path: root/tests/Unit/Exceptions
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-10-31 13:40:13 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-10-31 13:40:13 +0100
commit60fd72cd1a1e4e53b9af87e00a8c27687c6b5385 (patch)
treebcf250d05a49a848644af44f09fb897467e3ecb0 /tests/Unit/Exceptions
parentfb05a38a963784716c105e7f214615ad13d2f272 (diff)
Added service providers
Diffstat (limited to 'tests/Unit/Exceptions')
-rw-r--r--tests/Unit/Exceptions/ExceptionsServiceProviderTest.php39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
new file mode 100644
index 00000000..26eddb75
--- /dev/null
+++ b/tests/Unit/Exceptions/ExceptionsServiceProviderTest.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Engelsystem\Test\Exceptions;
+
+use Engelsystem\Application;
+use Engelsystem\Exceptions\ExceptionsServiceProvider;
+use Engelsystem\Exceptions\Handler as ExceptionHandler;
+use PHPUnit\Framework\TestCase;
+use PHPUnit_Framework_MockObject_MockObject;
+
+class ExceptionsServiceProviderTest extends TestCase
+{
+ /**
+ * @covers \Engelsystem\Exceptions\ExceptionsServiceProvider::register()
+ */
+ public function testRegister()
+ {
+ /** @var PHPUnit_Framework_MockObject_MockObject|ExceptionHandler $exceptionHandler */
+ $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->expects($this->once())
+ ->method('instance')
+ ->with('error.handler', $exceptionHandler);
+
+ $serviceProvider = new ExceptionsServiceProvider($app);
+ $serviceProvider->register();
+ }
+}