summaryrefslogtreecommitdiff
path: root/tests/Unit/Http
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-13 17:48:07 +0100
committermsquare <msquare@notrademark.de>2018-12-02 12:53:31 +0100
commit9788c5095a67a45fe3545ae0fc747b8e629ea4fd (patch)
treeac6edc92fcf08c40d4b517529a76ab9f230829f0 /tests/Unit/Http
parent2588bbf7bc5374830662af7c01df688c42d30dc6 (diff)
Implemented HttpException
Diffstat (limited to 'tests/Unit/Http')
-rw-r--r--tests/Unit/Http/Exceptions/HttpExceptionTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Unit/Http/Exceptions/HttpExceptionTest.php b/tests/Unit/Http/Exceptions/HttpExceptionTest.php
new file mode 100644
index 00000000..ce2b064d
--- /dev/null
+++ b/tests/Unit/Http/Exceptions/HttpExceptionTest.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Http\Exceptions;
+
+use Engelsystem\Http\Exceptions\HttpException;
+use PHPUnit\Framework\TestCase;
+
+class HttpExceptionTest extends TestCase
+{
+ /**
+ * @covers \Engelsystem\Http\Exceptions\HttpException::__construct
+ * @covers \Engelsystem\Http\Exceptions\HttpException::getStatusCode
+ * @covers \Engelsystem\Http\Exceptions\HttpException::getHeaders
+ */
+ public function testConstruct()
+ {
+ $exception = new HttpException(123);
+ $this->assertEquals(123, $exception->getStatusCode());
+ $this->assertEquals('', $exception->getMessage());
+ $this->assertEquals([], $exception->getHeaders());
+
+ $exception = new HttpException(404, 'Nothing found', ['page' => '/test']);
+ $this->assertEquals('Nothing found', $exception->getMessage());
+ $this->assertEquals(['page' => '/test'], $exception->getHeaders());
+ }
+}