diff --git a/tests/HttpExceptionTest.php b/tests/HttpExceptionTest.php
index <HASH>..<HASH> 100644
--- a/tests/HttpExceptionTest.php
+++ b/tests/HttpExceptionTest.php
@@ -28,4 +28,10 @@ class HttpExceptionTest extends \PHPUnit_Framework_TestCase {
         $httpException = new HttpException('', HttpCode::BAD_REQUEST);
         $this->assertSame(HttpCode::BAD_REQUEST, $httpException->getCode());
     }
+
+    public function testFailsIfProvidedCodeIsInvalid()
+    {
+        $this->setExpectedException('\Exception');
+        new HttpException('', 9999);
+    }
 }
Added test for failing in case of invalid code in HttpException.