Fixed capitalization, tests
This commit is contained in:
@ -1,17 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\SimpleJwt;
|
||||
namespace NoccyLabs\SimpleJWT;
|
||||
|
||||
use NoccyLabs\SimpleJwt\Key\JwtPlaintextKey;
|
||||
use NoccyLabs\SimpleJWT\Key\JWTPlaintextKey;
|
||||
|
||||
class JwtTokenTest extends \PhpUnit\Framework\TestCase
|
||||
class JWTTokenTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers
|
||||
*/
|
||||
public function testGeneratingTokens()
|
||||
{
|
||||
$key = new JwtPlaintextKey("test");
|
||||
$key = new JWTPlaintextKey("test");
|
||||
|
||||
$tok = new JwtToken($key);
|
||||
$tok = new JWTToken($key);
|
||||
$tok->addClaim("foo", true);
|
||||
|
||||
$token = $tok->getSignedToken();
|
||||
@ -20,19 +23,22 @@ class JwtTokenTest extends \PhpUnit\Framework\TestCase
|
||||
$this->assertTrue($tok->isGenerated());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers
|
||||
*/
|
||||
public function testParsingTokens()
|
||||
{
|
||||
$key = new JwtPlaintextKey("test");
|
||||
$key = new JWTPlaintextKey("test");
|
||||
|
||||
$tok = new JwtToken($key);
|
||||
$tok = new JWTToken($key);
|
||||
$tok->addClaim("foo", true);
|
||||
|
||||
$token = $tok->getSignedToken();
|
||||
|
||||
$parsed = new JwtToken($key, $token);
|
||||
$parsed = new JWTToken($key, $token);
|
||||
|
||||
$this->assertTrue($parsed->isValid());
|
||||
$this->assertFalse($parsed->isGenerated());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user