-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds and implements QueryAuthException interface
- Loading branch information
1 parent
f8403e9
commit c30d1d0
Showing
4 changed files
with
38 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
/** | ||
* Query Auth: Signature generation and validation for REST API query authentication | ||
* | ||
* @copyright 2013 Jeremy Kendall | ||
* @license https://github.com/jeremykendall/query-auth/blob/master/LICENSE MIT | ||
* @link https://github.com/jeremykendall/query-auth | ||
*/ | ||
|
||
namespace QueryAuth\Exception; | ||
|
||
interface QueryAuthException {} |
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
24 changes: 24 additions & 0 deletions
24
tests/QueryAuth/Tests/Exception/QueryAuthExceptionTest.php
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,24 @@ | ||
<?php | ||
|
||
namespace QueryAuth\Tests; | ||
|
||
use QueryAuth\Exception\QueryAuthException; | ||
use QueryAuth\Exception\SignatureMissingException; | ||
use QueryAuth\Exception\TimeOutOfBoundsException; | ||
|
||
class QueryAuthExceptionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testSignatureMissingException() | ||
{ | ||
$e = new SignatureMissingException(); | ||
$this->assertInstanceOf('QueryAuth\Exception\SignatureMissingException', $e); | ||
$this->assertInstanceOf('QueryAuth\Exception\QueryAuthException', $e); | ||
} | ||
|
||
public function testTimeOutOfBoundsException() | ||
{ | ||
$e = new TimeOutOfBoundsException(); | ||
$this->assertInstanceOf('QueryAuth\Exception\TimeOutOfBoundsException', $e); | ||
$this->assertInstanceOf('QueryAuth\Exception\QueryAuthException', $e); | ||
} | ||
} |