summaryrefslogtreecommitdiff
path: root/tests/Unit/Exceptions/HandlerTest.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-11-20 17:08:05 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-11-25 11:27:38 +0100
commit6eea072376cc9fd1034342a0e1d2173681268138 (patch)
treea7331868cb29fad083f93fe6f8e31e918da25bdd /tests/Unit/Exceptions/HandlerTest.php
parente54a10b81679bae9d19337617d6c58310d2f7a58 (diff)
Added ExceptionHandler Interface
Diffstat (limited to 'tests/Unit/Exceptions/HandlerTest.php')
-rw-r--r--tests/Unit/Exceptions/HandlerTest.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/Unit/Exceptions/HandlerTest.php b/tests/Unit/Exceptions/HandlerTest.php
new file mode 100644
index 00000000..29759be7
--- /dev/null
+++ b/tests/Unit/Exceptions/HandlerTest.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Exceptions;
+
+use Engelsystem\Exceptions\Handler;
+use PHPUnit\Framework\TestCase;
+use PHPUnit_Framework_MockObject_MockObject as Mock;
+
+class HandlerTest extends TestCase
+{
+ /**
+ * @covers \Engelsystem\Exceptions\Handler::__construct()
+ * @covers \Engelsystem\Exceptions\Handler::register()
+ */
+ public function testRegister()
+ {
+ /** @var Handler|Mock $handler */
+ $handler = $this->getMockForAbstractClass(Handler::class);
+ $this->assertInstanceOf(Handler::class, $handler);
+ $handler->register();
+ }
+
+ /**
+ * @covers \Engelsystem\Exceptions\Handler::setEnvironment()
+ * @covers \Engelsystem\Exceptions\Handler::getEnvironment()
+ */
+ public function testEnvironment()
+ {
+ /** @var Handler|Mock $handler */
+ $handler = $this->getMockForAbstractClass(Handler::class);
+
+ $handler->setEnvironment(Handler::ENV_DEVELOPMENT);
+ $this->assertEquals(Handler::ENV_DEVELOPMENT, $handler->getEnvironment());
+
+ $handler->setEnvironment(Handler::ENV_PRODUCTION);
+ $this->assertEquals(Handler::ENV_PRODUCTION, $handler->getEnvironment());
+ }
+}