Fixed capitalization, tests

This commit is contained in:
2023-04-09 02:40:21 +02:00
parent 6b1d3178cf
commit 953e831d84
25 changed files with 199 additions and 161 deletions

View File

@ -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());
}
}
}