From 6eea072376cc9fd1034342a0e1d2173681268138 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 20 Nov 2017 17:08:05 +0100 Subject: Added ExceptionHandler Interface --- tests/Unit/Exceptions/HandlerTest.php | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/Unit/Exceptions/HandlerTest.php (limited to 'tests/Unit/Exceptions/HandlerTest.php') 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 @@ +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()); + } +} -- cgit v1.2.3-70-g09d2