Fixed case in test filenames
This commit is contained in:
50
tests/JWTTokenTest.php
Normal file
50
tests/JWTTokenTest.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace NoccyLabs\SimpleJWT;
|
||||
|
||||
use NoccyLabs\SimpleJWT\Key\JWTPlaintextKey;
|
||||
|
||||
class JWTTokenTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* @covers NoccyLabs\SimpleJWT\JWTToken
|
||||
* @covers NoccyLabs\SimpleJWT\Key\JWTPlaintextKey
|
||||
* @covers NoccyLabs\SimpleJWT\Collection\PropertyBag
|
||||
* @covers NoccyLabs\SimpleJWT\JWTUtil
|
||||
*/
|
||||
public function testGeneratingTokens()
|
||||
{
|
||||
$key = new JWTPlaintextKey("test");
|
||||
|
||||
$tok = new JWTToken($key);
|
||||
$tok->addClaim("foo", true);
|
||||
|
||||
$token = $tok->getSignedToken();
|
||||
|
||||
$this->assertNotNull($token);
|
||||
$this->assertTrue($tok->isGenerated());
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers NoccyLabs\SimpleJWT\JWTToken
|
||||
* @covers NoccyLabs\SimpleJWT\Key\JWTPlaintextKey
|
||||
* @covers NoccyLabs\SimpleJWT\Collection\PropertyBag
|
||||
* @covers NoccyLabs\SimpleJWT\JWTUtil
|
||||
*/
|
||||
public function testParsingTokens()
|
||||
{
|
||||
$key = new JWTPlaintextKey("test");
|
||||
|
||||
$tok = new JWTToken($key);
|
||||
$tok->addClaim("foo", true);
|
||||
|
||||
$token = $tok->getSignedToken();
|
||||
|
||||
$parsed = new JWTToken($key, $token);
|
||||
|
||||
$this->assertTrue($parsed->isValid());
|
||||
$this->assertFalse($parsed->isGenerated());
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user