-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exception Unit Tests + Exception Abstraction
- Loading branch information
1 parent
8fdaf83
commit eb1972f
Showing
21 changed files
with
124 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: mrussell | ||
* Date: 1/20/17 | ||
* Time: 10:51 AM | ||
*/ | ||
|
||
namespace MRussell\REST\Exception\Client; | ||
|
||
use MRussell\REST\Exception\RestClientException; | ||
|
||
class ClientException extends \Exception { | ||
class ClientException extends RestClientException { | ||
|
||
protected $message = 'Unknown REST Client Exception occurred.'; | ||
protected $message = 'Unknown Exception occurred on REST Client: %s'; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace MRussell\REST\Exception\Endpoint; | ||
|
||
use MRussell\REST\Exception\RestClientException; | ||
|
||
class EndpointException extends RestClientException | ||
{ | ||
protected $message = 'Unknown Exception occurred on Endpoint: %s'; | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace MRussell\REST\Exception\Endpoint; | ||
|
||
class InvalidOptions extends EndpointException | ||
{ | ||
protected $message = 'Invalid or missing options of Endpoint: %s'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace MRussell\REST\Exception\Endpoint; | ||
|
||
class InvalidRequest extends EndpointException | ||
{ | ||
protected $message = 'Request Property not configured on Endpoint: %s'; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: mrussell | ||
* Date: 1/19/17 | ||
* Time: 10:35 PM | ||
*/ | ||
|
||
namespace MRussell\REST\Exception\Endpoint; | ||
|
||
|
||
class UnknownEndpoint extends Exception | ||
class UnknownEndpoint extends EndpointException | ||
{ | ||
protected $message = 'An Unknown Endpoint [%s] was requested.'; | ||
|
||
|
||
protected $code = 404; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace MRussell\REST\Exception; | ||
|
||
class RestClientException extends \Exception | ||
{ | ||
protected $message = 'An Unknown Exception occurred in the REST Client Framework'; | ||
|
||
public function __construct($args = array()) { | ||
if (!empty($args)){ | ||
$this->message = vsprintf($this->message,$args); | ||
} | ||
parent::__construct($this->message); | ||
} | ||
} |
Oops, something went wrong.