Webservice client unit tests and fixes for bugs discovered while creating them

This commit is contained in:
Gregory Oschwald
2013-05-08 14:42:13 -07:00
parent 7559b5d3d0
commit 851925b2d6
10 changed files with 405 additions and 34 deletions
@@ -0,0 +1,7 @@
<?php
namespace GeoIP2\Exception;
class GenericException extends \Exception
{
}
+3 -1
View File
@@ -4,11 +4,13 @@ namespace GeoIP2\Exception;
class HttpException extends \Exception
{
public $code;
public function __construct($message, $code, $uri,
Exception $previous = null)
{
parent::__construct($message, $code, $previous);
$this->code = $code;
parent::__construct($message, null, $previous);
}
}
@@ -0,0 +1,16 @@
<?php
namespace GeoIP2\Exception;
class WebserviceException extends HttpException
{
public $httpStatus;
public function __construct($message, $code, $httpStatus, $uri,
Exception $previous = null)
{
$this->httpStatus = $httpStatus;
parent::__construct($message, $code, $uri, $previous);
}
}