Skip to content

Commit

Permalink
Added correct coverage annotations to test suite based on new code ad…
Browse files Browse the repository at this point in the history
…ded.
  • Loading branch information
RobDWaller committed Nov 21, 2019
1 parent 30f5cd1 commit 2cf470a
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 1 deletion.
17 changes: 17 additions & 0 deletions tests/Auth/AuthenticateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function testAuthenticate()
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Request
*/
public function testAuthenticateOk()
{
Expand Down Expand Up @@ -77,6 +78,8 @@ public function testAuthenticateOk()
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Parser\ParseException
*/
public function testAuthenticateBadRequest()
{
Expand Down Expand Up @@ -264,6 +267,10 @@ public function testValidationResponseErrors()
* @uses PsrJwt\Auth\Authenticate
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Request
*/
public function testGetToken()
{
Expand All @@ -288,6 +295,9 @@ public function testGetToken()
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testGetTokenCookie()
{
Expand Down Expand Up @@ -316,6 +326,8 @@ public function testGetTokenCookie()
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testGetTokenBody()
{
Expand Down Expand Up @@ -347,6 +359,8 @@ public function testGetTokenBody()
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testGetTokenBodyObject()
{
Expand Down Expand Up @@ -382,6 +396,7 @@ public function testGetTokenBodyObject()
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testGetTokenQuery()
{
Expand Down Expand Up @@ -419,6 +434,8 @@ public function testGetTokenQuery()
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Parser\ParseException
*/
public function testGetTokenNoToken()
{
Expand Down
8 changes: 8 additions & 0 deletions tests/Factory/JwtMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function testJwtMiddlewareHtml()
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Validation\Validate
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testFactoryValidation()
{
Expand Down Expand Up @@ -81,6 +85,10 @@ public function testFactoryValidation()
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Validation\Validate
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testJsonFactoryValidation()
{
Expand Down
7 changes: 7 additions & 0 deletions tests/Handler/HtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function testAuthHandler()
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Request
*/
public function testAuthenticateOk()
{
Expand Down Expand Up @@ -86,6 +87,7 @@ public function testAuthenticateOk()
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Request
*/
public function testAuthenticateNoBody()
{
Expand Down Expand Up @@ -133,6 +135,8 @@ public function testAuthenticateNoBody()
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Parser\ParseException
*/
public function testAuthenticateBadRequest()
{
Expand Down Expand Up @@ -177,7 +181,10 @@ public function testAuthenticateBadRequest()
* @uses PsrJwt\Validation\Validate
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Request
*/
public function testAuthenticateUnauthorized()
{
Expand Down
6 changes: 6 additions & 0 deletions tests/Handler/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public function testJsonAuthHandler()
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Request
*/
public function testAuthenticateOk()
{
Expand Down Expand Up @@ -82,7 +84,11 @@ public function testAuthenticateOk()
* @uses PsrJwt\Auth\Auth
* @uses PsrJwt\Validation\Validate
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Request
*/
public function testAuthenticateFail()
{
Expand Down
13 changes: 13 additions & 0 deletions tests/Helper/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,26 @@ class RequestTest extends TestCase
'wIjoxNTczNzE2NDA3LCJpYXQiOjE1NzM3MTU1MDcsInVzZXJfaWQiOiIzMTM4NjE2MiJ9.' .
'9Es0wWdByOQAU8WfcufxgRa9GEYwLefhRzclwWcgVCQ';

/**
* @covers PsrJwt\Helper\Request
*/
public function testRequest()
{
$request = new Request();

$this->assertInstanceOf(Request::class, $request);
}

/**
* @covers PsrJwt\Helper\Request::getParsedToken
* @uses PsrJwt\Factory\Jwt
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testGetParsedToken()
{
$httpRequest = m::mock(ServerRequestInterface::class);
Expand Down
12 changes: 12 additions & 0 deletions tests/JwtAuthMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function testJwtAuthProcess()
* @uses PsrJwt\Validation\Validate
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Handler\Html
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Request
*/
public function testProcess()
{
Expand Down Expand Up @@ -90,6 +94,8 @@ public function testProcess()
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Handler\Html
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Parser\ParseException
*/
public function testProcessFail()
{
Expand Down Expand Up @@ -130,6 +136,11 @@ public function testProcessFail()
* @uses PsrJwt\Validation\Validate
* @uses PsrJwt\Parser\Parse
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Handler\Html
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Handler\Html
*/
public function testInvoke()
Expand Down Expand Up @@ -184,6 +195,7 @@ public function testInvoke()
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Handler\Html
* @uses PsrJwt\Parser\Request
*/
public function testInvokeFail()
{
Expand Down
3 changes: 3 additions & 0 deletions tests/Parser/ParseExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class ParseExceptionTest extends TestCase
{
/**
* @covers PsrJwt\Parser\ParseException
*/
public function testParseException()
{
$exception = new ParseException('Error', 1, null);
Expand Down
2 changes: 1 addition & 1 deletion tests/Parser/ParseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class ParseTest extends TestCase
{
/**
* @covers PsrJwt\Parser\Parse::__construct
* @covers PsrJwt\Parser\Parse
*/
public function testParse()
{
Expand Down
21 changes: 21 additions & 0 deletions tests/Parser/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

class RequestTest extends TestCase
{
/**
* @covers PsrJwt\Parser\Request
* @uses PsrJwt\Parser\Parse
*/
public function testRequest()
{
$parse = new Parse();
Expand All @@ -19,6 +23,14 @@ public function testRequest()
$this->assertInstanceOf(Request::class, $request);
}

/**
* @covers PsrJwt\Parser\Request::parse
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
*/
public function testParse()
{
$parse = m::mock(Parse::class);
Expand All @@ -36,6 +48,15 @@ public function testParse()
$this->assertSame('abcdef.123.abcdef', $request->parse($httpRequest, 'jwt'));
}

/**
* @covers PsrJwt\Parser\Request::parse
* @uses PsrJwt\Parser\Request
* @uses PsrJwt\Parser\Bearer
* @uses PsrJwt\Parser\Cookie
* @uses PsrJwt\Parser\Body
* @uses PsrJwt\Parser\Query
* @uses PsrJwt\Parser\ParseException
*/
public function testParseNoToken()
{
$parse = m::mock(Parse::class);
Expand Down

0 comments on commit 2cf470a

Please sign in to comment.